Probably SymPy is not installed on the OnlineGDB server.
One reason could be that if plotting is supported, that wouldn't work as OnlineGDB only relays standard output to your browser (so graphics would make no sense as you won't be able to see it anyway).