1

Trying to upgrade pip in my terminal. Here's my code:

(env) macbook-pro83:zappatest zorgan$ 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 ./env/lib/python3.5/site-packages
You are using pip version 8.1.2, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Any idea what the problem is? I also get the same error There was a problem confirming the ssl certificate when I perform pip install django.

Edit pip install --upgrade pip -vvv returns:

1 location(s) to search for versions of pip:
* https://pypi.python.org/simple/pip/
Getting page https://pypi.python.org/simple/pip/
Looking up "https://pypi.python.org/simple/pip/" in the cache
Returning cached "301 Moved Permanently" response (ignoring date and etag information)
Looking up "https://pypi.org/simple/pip/" in the cache
Current age based on date: 23811
Freshness lifetime from max-age: 600
Freshness lifetime from request max-age: 600
Starting new HTTPS connection (1): pypi.org
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
Installed version (8.1.2) is most up-to-date (past versions: none)
Requirement already up-to-date: pip in ./env/lib/python3.5/site-packages
Cleaning up...
You are using pip version 8.1.2, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Zorgan
  • 8,227
  • 23
  • 106
  • 207
  • Possible duplicate of [Not able to install Python packages \[SSL: TLSV1\_ALERT\_PROTOCOL\_VERSION\]](https://stackoverflow.com/questions/49768770/not-able-to-install-python-packages-ssl-tlsv1-alert-protocol-version) – phd Jun 17 '18 at 11:47

3 Answers3

5

Managed to fix it (uninstall and reinstall pip) via the following command:

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

Zorgan
  • 8,227
  • 23
  • 106
  • 207
1

a. Check your system date and time and see whether it is correct.

b. If the 1st solution doesn't fix it try using a lower security method:

pip install --index-url=http://pypi.python.org/simple/linkchecker

This bypasses HTTPS and uses HTTP instead, try this workaround only if you are in a hurry.

c. Try downgrading pip to a version that does not use SSL verification by:

pip install pip==1.2.1

and then upgrade pip back again to the newer version by:

pip install --upgrade pip

d. If nothing of the above works, uninstall pip and reinstall it.

FutureJJ
  • 2,368
  • 1
  • 19
  • 30
  • Unfortunately neither of them worked. But I I manage to fix it with: `curl https://bootstrap.pypa.io/get-pip.py | python`. Thanks for the help – Zorgan Jun 16 '18 at 08:08
0

You can get more details about upgrade failed by using

$ pip install --upgrade pip -vvv

there will be more details help you debug it.


Try

pip --trusted-host pypi.python.org install --upgrade pip

Maybe useful.


Another solution:

$ pip install certifi

then run install.

pwxcoo
  • 2,903
  • 2
  • 15
  • 21
  • I've added the output to that in my edit. I'm assuming it's saying the URL is wrong..? However `https://pypi.org/simple/pip/` still seems to be fine. – Zorgan Jun 16 '18 at 05:48
  • Get the same error on your second option unfortunately – Zorgan Jun 16 '18 at 06:10