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

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

问题描述

pip install 对我来说每个包都失败了.这就是我得到的:

找不到满足要求的版本 匹配的发行版;

看到 类似 关于 StackOverflow 的问题,但它们似乎与这个问题并不完全相关.>

另外,这篇文章 表明如果 PyPI 关闭或我的 IP 地址被列入黑名单,这可能会发生.我的情况似乎都不是这样.

pip 在运行 pip install --upgrade pip 时显示最新.

解决方案

升级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 除非他们像上面那样升级 pip.

(注意通过pip install --upgrade pip升级pip也不会正确升级.这是一个先有鸡还是先有蛋的问题)

这个线程对此进行了解释(感谢 这篇推特帖子):

<块引用>

使用 pip 和 PyPI 的 Mac 用户:

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

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

我们建议您在 4 月 8 日之前完成.

Pip 9.0.3 在 macOS 上的系统 Python 下运行时支持 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

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

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