1

I'm using Ubuntu to run and compile python. When I tried to import matplotlib.pyplot it said it wasn't found. So I installed matplotlib using

pip install matplotlib

it said it installed but now I am getting the following error.

Traceback (most recent call last): File "Mat_To_Py.py", line 4, in import matplotlib. pyplot as plt File "/home/wincom/.local/lib/python2.7/site-packages/matplotlib/init.py", line 126, in from . import cbook ImportError: cannot import name cbook

What should I do to get it to work?

I've looked and see that other people have be getting different error but when I try those, it doesn't work for me.

  • Are you using a virtualenv/conda environment? – xxbidiao Jun 12 at 16:03
  • @xxbidiao I am not I am connecting to a server through PowerShell. – grt Jun 12 at 16:11
  • @xxbidiao I originally wrote my code in Anaconda. Now I'm transferring them to another server that uses Linux. In Anaconda, it runs correctly but in the server, it does not. – grt Jun 12 at 16:13
  • pip3 install matplotlib? askubuntu.com/questions/1037410/… – nexoma Jun 12 at 16:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.