Pip: Problem Confirming the SSL Certificate - OSX

Created on 15 Apr 2018  路  6Comments  路  Source: pypa/pip

  • Pip version: pip 9.0.1
  • Python version: Python 3.5.2 and Python 2.7.10 installed
  • Operating system: OSX - 10.13.4

Description:

I've tried to install Keras (keras.io) and faced with a problem related confirming ssl certificate.

What I've run:

First:

$ pip install keras
Collecting keras
  Could not fetch URL https://pypi.python.org/simple/keras/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:645) - skipping
  Could not find a version that satisfies the requirement keras (from versions: )
No matching distribution found for keras

Then I checked my system:

$ python -c "import ssl; print ssl.OPENSSL_VERSION"
LibreSSL 2.2.7
$ python --version
Python 2.7.10
$ python3 -c "import ssl; print (ssl.OPENSSL_VERSION)"
OpenSSL 0.9.8zh 14 Jan 2016
$ python3 --version
Python 3.5.2
$ pip --version
pip 9.0.1 from /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (python 3.5)

Actually it seems quite odd when I run pip, it automatically goes with Python3 but my defauly python is Python2. Can there be such conflict?

Also, I've tried upgrading pip:

$ pip install --upgrade pip
Could not fetch URL https://pypi.python.org/simple/pip/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:645) - skipping
Requirement already up-to-date: pip in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages
$ pip --version
pip 9.0.1 from /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (python 3.5)

Again SSL certificate error occurred.

support

Most helpful comment

Upgrade pip using.

curl https://bootstrap.pypa.io/get-pip.py | python3

Instead of pip install -U pip

All 6 comments

Upgrade pip using.

curl https://bootstrap.pypa.io/get-pip.py | python3

Instead of pip install -U pip

@jackton1 thank you.
Also I tried upgrading pip2 by curl https://bootstrap.pypa.io/get-pip.py | python but it didn't work.
However I solved the pip2 issue by: pip2 install --upgrade pip

@jackton1 Thanks! I use pytyon2.7 , upgrading by curl https://bootstrap.pypa.io/get-pip.py | python it work

This is due to the recent TLS support deprecation by Python.org sites. Need to upgrade pip (but without using pip!) See this SO post with details

@jackton1

Thanks!

Worked perfectly, I'm not getting the ssl error anymore and can finally install again.

I had the same problem, Run upgrade curl https://bootstrap.pypa.io/get-pip.py | python

Was this page helpful?
0 / 5 - 0 ratings