'pip install' 每个包都失败 ("Could not find a version that satisfies the requirement")
'pip install' fails for every package ("Could not find a version that satisfies the requirement")
pip install <package name>
对我来说每个包都失败了。这是我得到的:
Could not find a version that satisfies the requirement <package-name
(from versions: )
No matching distribution found for <package-name>
我 questions 在 Stack Overflow 上,但它们似乎与这个不完全相关。
此外,this post 表明如果 PyPI 关闭或我的 IP 地址被列入黑名单,则可能会发生这种情况。我的情况似乎两者都不成立。
pip 在 运行 pip install --upgrade pip
.
上显示最新
PyPI 放弃了对 TLS 1.0 和 1.1 的支持。如果您的系统没有使用更新的版本,它可以解释您的错误。
您可以尝试重新安装 pip system-wide,以将您的系统依赖项更新到更新版本的 TLS 吗?
这似乎与
有关
参见 Dominique Barton 的回答:
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-pip
On 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 pip
You can also try to update openssl
separately.
升级pip如下:
curl https://bootstrap.pypa.io/get-pip.py | python
注意:如果不是在虚拟环境中,您可能需要使用上面的sudo python
。
发生了什么:
Python.org 站点将停止支持 TLS 版本 1.0 和 1.1。这意味着 Mac OS X version 10.12 (Sierra) 或更早版本将无法使用 pip,除非他们像上面那样升级 pip。
(请注意,通过 pip install --upgrade pip
升级 pip 也不会正确升级它。这是一个 chicken-and-egg 问题)
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 | python
and 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/
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
最后,为避免其他安装错误,请确保在执行上述操作后还升级了 setuptools:
pip install --upgrade setuptools
pip install <package name>
对我来说每个包都失败了。这是我得到的:
Could not find a version that satisfies the requirement <package-name
(from versions: )
No matching distribution found for <package-name>
我
此外,this post 表明如果 PyPI 关闭或我的 IP 地址被列入黑名单,则可能会发生这种情况。我的情况似乎两者都不成立。
pip 在 运行 pip install --upgrade pip
.
PyPI 放弃了对 TLS 1.0 和 1.1 的支持。如果您的系统没有使用更新的版本,它可以解释您的错误。
您可以尝试重新安装 pip system-wide,以将您的系统依赖项更新到更新版本的 TLS 吗?
这似乎与
参见 Dominique Barton 的回答:
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-pip
On 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 pip
You can also try to update
openssl
separately.
升级pip如下:
curl https://bootstrap.pypa.io/get-pip.py | python
注意:如果不是在虚拟环境中,您可能需要使用上面的sudo python
。
发生了什么:
Python.org 站点将停止支持 TLS 版本 1.0 和 1.1。这意味着 Mac OS X version 10.12 (Sierra) 或更早版本将无法使用 pip,除非他们像上面那样升级 pip。
(请注意,通过 pip install --upgrade pip
升级 pip 也不会正确升级它。这是一个 chicken-and-egg 问题)
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 | python
and 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/
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
最后,为避免其他安装错误,请确保在执行上述操作后还升级了 setuptools:
pip install --upgrade setuptools