System: OX E Python source: python.org
I used pip to install matplotlib and here is the result I got
sudo pip install matplotlib
The directory '/Users/clarence/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. The directory '/Users/clarence/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Requirement already satisfied (use --upgrade to upgrade): matplotlib in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python Requirement already satisfied (use --upgrade to upgrade): numpy>=1.5 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from matplotlib) Requirement already satisfied (use --upgrade to upgrade): python-dateutil in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from matplotlib) Requirement already satisfied (use --upgrade to upgrade): tornado in /Library/Python/2.7/site-packages (from matplotlib) Requirement already satisfied (use --upgrade to upgrade): pyparsing>=1.5.6 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from matplotlib) Requirement already satisfied (use --upgrade to upgrade): nose in /Library/Python/2.7/site-packages (from matplotlib) Requirement already satisfied (use --upgrade to upgrade): certifi in /Library/Python/2.7/site-packages (from tornado->matplotlib) Requirement already satisfied (use --upgrade to upgrade): backports-abc>=0.4 in /Library/Python/2.7/site-packages (from tornado->matplotlib) Requirement already satisfied (use --upgrade to upgrade): backports.ssl-match-hostname in /Library/Python/2.7/site-packages (from tornado->matplotlib) Requirement already satisfied (use --upgrade to upgrade): singledispatch in /Library/Python/2.7/site-packages (from tornado->matplotlib) Requirement already satisfied (use --upgrade to upgrade): six in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from singledispatch->tornado->matplotlib) Clarences-MacBook-Pro:~ clarence$ sudo -H pip install matplotlib Requirement already satisfied (use --upgrade to upgrade): matplotlib in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python Requirement already satisfied (use --upgrade to upgrade): numpy>=1.5 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from matplotlib) Requirement already satisfied (use --upgrade to upgrade): python-dateutil in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from matplotlib) Requirement already satisfied (use --upgrade to upgrade): tornado in /Library/Python/2.7/site-packages (from matplotlib) Requirement already satisfied (use --upgrade to upgrade): pyparsing>=1.5.6 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from matplotlib) Requirement already satisfied (use --upgrade to upgrade): nose in /Library/Python/2.7/site-packages (from matplotlib) Requirement already satisfied (use --upgrade to upgrade): certifi in /Library/Python/2.7/site-packages (from tornado->matplotlib) Requirement already satisfied (use --upgrade to upgrade): backports-abc>=0.4 in /Library/Python/2.7/site-packages (from tornado->matplotlib) Requirement already satisfied (use --upgrade to upgrade): backports.ssl-match-hostname in /Library/Python/2.7/site-packages (from tornado->matplotlib) Requirement already satisfied (use --upgrade to upgrade): singledispatch in /Library/Python/2.7/site-packages (from tornado->matplotlib) Requirement already satisfied (use --upgrade to upgrade): six in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from singledispatch->tornado->matplotlib)
When I go ahead the import that library in python. python says it could not find the modulus.
python3.5 -c 'import matplotlib; print(matplotlib.__version__, matplotlib.__file__)'
Traceback (most recent call last): File "", line 1, in ImportError: No module named 'matplotlib'
How can I fix this?
pip
messages concern python 2.7, you are usingpython3.5
, you are running the wrong version ofpip
orpip
in a 2.7 environment. Installmatplotlib
in your 3.5 directory. – cdarkepip
for 3.5 and run that by specifying the full hierarchic name. If you don't know what that is then ask whoever installed 3.5. – cdarke