每个软件包的“点安装"失败(“找不到满足要求的版本") [英] 'pip install' fails for every package ("Could not find a version that satisfies the requirement")

查看:145
本文介绍了每个软件包的“点安装"失败(“找不到满足要求的版本")的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

pip install <package name>对我来说每个软件包都失败了.这就是我得到的:

Could not find a version that satisfies the requirement <package-name
(from versions: )
No matching distribution found for <package-name>

看到了 相似关于Stack Overflow的问题,但它们似乎与这一问题并不完全相关.

此外,此帖子建议,如果PyPI关闭或我的IP地址被列入黑名单,则可能会发生这种情况.对于我的情况,似乎两者都不正确.

pip显示运行pip install --upgrade pip的最新信息.

解决方案

升级点如下:

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

注意:如果不在虚拟环境中,则可能需要使用上面的sudo python.

发生了什么事

Python.org网站正在停止对TLS版本1.0和1.1的支持.这意味着 Mac OS X版本10.12 (Sierra)或更旧将无法使用点子,除非他们如上所述升级点子.

(请注意,通过pip install --upgrade pip升级点不能正确升级.这是鸡与蛋的问题)

线程对此进行了解释(感谢此Twitter帖子):

使用pip和PyPI的Mac用户:

如果您运行的是macOS/OS X版本10.12或更早版本,则应该 升级到最新的pip(9.0.3)以连接到Python包 安全索引:

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

我们建议您在4月8日之前这样做.

在macOS上的系统Python下运行时,Pip 9.0.3支持TLSv1.2. 10.13.官方发行说明: https://pip.pypa.io/en/stable/news/

此外, Python状态页面:

已完成-滚动式电源不足已结束,并且TLSv1.0和TLSv1.1已被禁用.世界标准时间4月11日15:37

更新-滚动停电已升级为停电,TLSv1.0和TLSv1.1将始终被HTTP 403拒绝. 世界标准时间4月8日15:49

最后,为避免其他安装错误,请确保在执行上述操作后还升级了setuptools:

pip install --upgrade setuptools

pip install <package name> is failing for every package for me. This is what I get:

Could not find a version that satisfies the requirement <package-name
(from versions: )
No matching distribution found for <package-name>

I saw similar questions on Stack Overflow, but they don't seem to be fully related to this one.

Also, this post suggests that this might happen if PyPI is down or my IP address is blacklisted. It seems both are not true for my case.

pip shows up-to-date on running pip install --upgrade pip.

解决方案

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 | 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/

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

这篇关于每个软件包的“点安装"失败(“找不到满足要求的版本")的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆