0

I'm using cygwin in Windows to install matplotlib, via pip command. Command I used:

pip install matplotlib

Message was: "matplotlib successfully installed". I proceeded to run the script, but got the error:

ImportError: No module named matplotlib.pyplot

I then found this answer, saying I am supposed to use python -m pip install matplotlib instead of the previous command.

However, after entering that command, following error shows:

/usr/bin/python: No module named pip

How come do I get this error? pip does exist in my machine. How can I successfully access/install the matplotlib module?

Snow
  • 1,058
  • 2
  • 19
  • 47
  • I restorted to PyCharm for now. The IDE doesn't have these issues, and it's easy to use – Snow Mar 16 '18 at 12:05

1 Answers1

0

Depending on what version of Python 3 you have (generally for 3.4 and above), you may want to try the script pip3 install matplotlib. pip3 is the Python 3 version of pip and it installs the Python 3 version of matplotlib if it is available.

The problem may also be in your script. Try importing the entire matplotlib library into your program and see if that makes any difference.

  • if I use `pip3` command, the message is same as with pip: "Requirement already satisfied". Also the problem is not in the script, because not even the entire library can be loaded – Snow Mar 15 '18 at 14:44