ImportError: No module named matplotlib.pyplot
You have two pythons installed on your machine, one is the standard python that comes with Mac OSX and the second is the one you installed with ports (this is the one that has matplotlib
installed in its library, the one that comes with macosx does not).
/usr/bin/python
Is the standard mac python and since it doesn't have matplotlib
you should always start your script with the one installed with ports.
If python your_script.py
works then change the #!
to:
#!/usr/bin/env python
Or put the full path to the python interpreter that has the matplotlib
installed in its library.
Unable to use matplotlib after installation no module named 'matplotlib'
Can you check where the matplotlib
package has been installed through this command?
pip show matplotlib
And you are using the global Python on your computer:
C:/Users/USER/AppData/Local/Programs/Python/Python38/python.exe
It should be different.
You can switch to the python interpreter which you have installed the packages you want to import. Or install the packages in the interpreter you are using.
ModuleNotFoundError: No module named 'matplotlib'
use pip3 install matplotlib
to install matlplot lib.
By default, pip will install those package for 2.7 as it the native one.
using pip3 makes it specific for python 3, and make sure you have only one version of python 3
ModuleNotFoundError: No module named 'matplotlib.pyplotp'
As people in the comments pointed out, you simply have a typo in the import code.
As a side note, please do not post screenshots of code.
Instead copy the code and error message and format them as code in the question itself.
E.G:
import numpy as np
import matplotlib.pyplotp as plt
import pandas as pd
----------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-23-715cc5d20d02> in <module>
1 import numpy as np
--->2 import matplotlib.pyplotp as plt
3 import pandas as pd
ModuleNotFoundError: No module named 'matplotlib.pyplotp'
Related Topics
Accessing Attributes on Literals Work on All Types, But Not 'Int'; Why
Split a String to Even Sized Chunks
Add Sum of Values of Two Lists into New List
Python - Rolling Functions for Groupby Object
How to Separate the Functions of a Class into Multiple Files
Script Using Multiprocessing Module Does Not Terminate
How to Read Hdf5 Files in Python
How to Use Brew Installed Python as the Default Python
Clicking on Svg Using Selenium Python
Catching an Exception While Using a Python 'With' Statement
Setting Stacksize in a Python Script
Find First Sequence Item That Matches a Criterion
Failed to Catch Syntax Error Python
Upload Files in Google App Engine
Moving X-Axis to the Top of a Plot in Matplotlib
Meaning of Inter_Op_Parallelism_Threads and Intra_Op_Parallelism_Threads
Pandas Group by and Find First Non Null Value for All Columns