'pip install' fails for every package ("Could not find a version that satisfies the requirement")
'pip install' fails for every package ("Could not find a version that satisfies the requirement")
--
Become part of the top 3% of the developers by applying to Toptal
https://topt.al/25cXVn
--
Music by Eric Matyas
https://www.soundimage.org
Track title: Cool Puzzler LoFi
--
Chapters
00:00 Question
00:45 Accepted answer (Score 180)
02:53 Answer 2 (Score 11)
04:12 Thank you
--
Full question
https://stackoverflow.com/questions/4974...
Question links:
[saw]: https://stackoverflow.com/q/38903415/152...
[similar]: https://stackoverflow.com/q/31719816/152...
[questions]: https://stackoverflow.com/q/43218164/152...
[this post]: https://bhch.github.io/posts/2017/04/fix.../
Accepted answer links:
[Mac OS X version 10.12]: https://en.wikipedia.org/wiki/MacOS_Sier...
[This]: https://mail.python.org/pipermail/distut...
[this Twitter post]: https://twitter.com/brainwane/status/980...
[https://pip.pypa.io/en/stable/news/]: https://pip.pypa.io/en/stable/news/
[Python status page]: https://status.python.org/
Answer 2 links:
[Unable to install Python libraries]: https://stackoverflow.com/questions/4973...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python #pip #pypi
#avk47
ACCEPTED ANSWER
Score 187
Upgrade pip as follows:
curl https://bootstrap.pypa.io/get-pip.py | python
Note: You may need to use sudo python above if not in a virtual environment.
What's happening:
Python.org sites are stopping support for TLS versions 1.0 and 1.1. This means that Mac OS X version 10.12 (Sierra) or older will not be able to use pip unless they upgrade pip as above.
(Note that upgrading pip via pip install --upgrade pip will also not upgrade it correctly. It is a chicken-and-egg issue)
This thread explains it (thanks to this Twitter post):
Mac users who use pip and PyPI:
If you are running macOS/OS X version 10.12 or older, then you ought to upgrade to the latest pip (9.0.3) to connect to the Python Package Index securely:
curl https://bootstrap.pypa.io/get-pip.py | pythonand we recommend you do that by April 8th.
Pip 9.0.3 supports TLSv1.2 when running under system Python on macOS < 10.13. Official release notes: https://pip.pypa.io/en/stable/news/
Also, the Python status page:
Completed - The rolling brownouts are finished, and TLSv1.0 and TLSv1.1 have been disabled. Apr 11, 15:37 UTC
Update - The rolling brownouts have been upgraded to a blackout, TLSv1.0 and TLSv1.1 will be rejected with a HTTP 403 at all times. Apr 8, 15:49 UTC
Lastly, to avoid other install errors, make sure you also upgrade setuptools after doing the above:
pip install --upgrade setuptools
ANSWER 2
Score 12
Support for TLS 1.0 and 1.1 was dropped for PyPI. If your system does not use a more recent version, it could explain your error.
Could you try reinstalling pip system-wide, to update your system dependencies to a newer version of TLS?
This seems to be related to Unable to install Python libraries
See Dominique Barton's answer:
Apparently pip is trying to access PyPI via HTTPS (which is encrypted and fine), but with an old (insecure) SSL version. Your system seems to be out of date. It might help if you update your packages.
On Debian-based systems I'd try:
apt-get update && apt-get upgrade python-pipOn Red Hat Linux-based systems:
yum update python-pip # (or python2-pip, at least on Red Hat Linux 7)On Mac:
sudo easy_install -U pipYou can also try to update
opensslseparately.