Giancarlo Betti
Giancarlo Betti

Reputation: 1

Issues with matplotlib

Hey guys so i already installed matplotlib. Whenever i run the command to install it i get this:

Requirement already satisfied: matplotlib in 

c:\users\gianc\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (3.3.0)
Requirement already satisfied: cycler>=0.10 in c:\users\gianc\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from matplotlib) (0.10.0)
Requirement already satisfied: numpy>=1.15 in c:\users\gianc\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from matplotlib) (1.19.1)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in c:\users\gianc\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from matplotlib) (2.4.7)
Requirement already satisfied: pillow>=6.2.0 in c:\users\gianc\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from matplotlib) (7.2.0)
Requirement already satisfied: kiwisolver>=1.0.1 in c:\users\gianc\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from matplotlib) (1.2.0)
Requirement already satisfied: python-dateutil>=2.1 in c:\users\gianc\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from matplotlib) (2.8.1)
Requirement already satisfied: six in c:\users\gianc\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from cycler>=0.10->matplotlib) (1.15.0)

So it looks like its already installed. However, whenever i try importing it with import matplotlib.pylab as plt i get this error

File "d:/Documents/Python2/ranhw.py", line 2, in <module>
    import matplotlib.pylab as plt
ModuleNotFoundError: No module named 'matplotlib'

Any clue as to what might be happening here?

Upvotes: 0

Views: 140

Answers (1)

lpd11
lpd11

Reputation: 133

You have installed matplotlib for Python 3.8, but are trying to use it in Python 2.

Run pip2 install matplotlib instead.

Upvotes: 1

Related Questions