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.
matplotlib error in notebook :No module named 'matplotlib'
enter image description hereTry these things on your Anaconda Prompt terminal:
- pip -V <- The version of pip will be displayed, if it is successfully installed on your system. Then we will try to upgrade it.
- pip install --upgrade pip <- do this to upgrade your pip, if it is already upgraded then it will show it.
- pip install matplotlib <- then write this command if still doesn't work let me know in the comments
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
Delete All Files Except the Newest 3 in Bash Script
How to Limit File Size on Commit
Using Curl in a Bash Script and Getting Curl: (3) Illegal Characters Found in Url
What Is the Linux Built-In Driver Load Order
Linux: Block Until a String Is Matched in a File ("Tail + Grep with Blocking")
Position of a String Within a String Using Linux Shell Script
How to Connect to the Fitbit Zip Over Bluetooth 4.0 Le on Linux with Bluez
Differencebetween "Var=${Var:-Word}" and "Var=${Var:=Word}"
How to Read the Mouse Button State from /Dev/Input/Mice
Creating Permanent Executable Aliases
What Is the Windows Equivalent of Linux Command Wc -L
Curl: (7) Failed to Connect to Port 80, and 443 - on One Domain
How to Create an Rs256 Jwt Assertion with Bash/Shell Scripting