Quoll
Quoll

Reputation: 29

Can't install MatPlotLib for python 3 Mac OSX El Capitan

I am very new to coding and don't understand install processes. I am using Python 3.7.0 on Max OSX El Capitan. I want to install matplotlib but I tried this in terminal :

$ pip install matplotlib 

and it gave me an error that :

192-168-1-107:~ Ada1$ pip install matplotlib Requirement already satisfied: matplotlib in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python 
Requirement already satisfied: numpy>=1.5 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from matplotlib)  
Requirement already satisfied: python-dateutil in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from matplotlib)     
Collecting tornado (from matplotlib) Could not fetch URL https://pypi.python.org/simple/tornado/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) - skipping Could not find a version that satisfies the requirement tornado (from matplotlib) (from versions: ) No matching distribution found for tornado (from matplotlib)

I also tried :

$ sudo pip install matplotlib

but same error and python gives the error it is not installed. Help?

Upvotes: 2

Views: 573

Answers (1)

Evgeny
Evgeny

Reputation: 4541

Basically there are 3 possible causes I can see:

  • conflict of python 3 or 2 versions (most liekly)
  • OSX-specific bugs (needs a newer pip version as discussed here),
  • you are behind firewal (you can disable SSL by adding flags to pip command)

To make sure you are installing to python 3 you can use:

pip3 install -U matplotlib

Vertual environments and pipenv, conda and possibly poetry are your friends to achive greater isolation of python project setups in the future.

Upvotes: 1

Related Questions