Reputation: 33
Um... I wanted to import matplotlib in Python IDLE, but it said
>>> import matplotlib
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
import matplotlib
ModuleNotFoundError: No module named 'matplotlib'
I've already tried pip thing and the conda thing in terminal. It said
# All requested packages already installed.
# packages in environment at /Users/Dan/anaconda:
Then! what's the problem here?
Upvotes: 3
Views: 8125
Reputation: 51
I had the same issue using the same command in IDLE. I just figured it out. go to your terminal and enter:
pip3.6 install matplotlib
I was using pip3 instead of pip3.6
Upvotes: 5
Reputation: 229
You may have installed Matplotlib to Python 2.7 and not Python 3.6. To install it to Python3 you need to use pip3:
pip3 install matplotlib
Then open python3.6 from your terminal (not idle) and try importing matplotlib from there. This way you can use any text editor you wish, and run your code from the terminal.
Upvotes: 5