PIP 随机失败“无法找到满足要求的版本”,且具有相同的requirements.txt

2024-02-25

作为 CI 测试的一部分,我们安装了一个 virtualenv,其中包含来自常量 requests.txt 文件的一些 pip 包。

由于requirements.txt文件没有改变,这个安装过程有时会随机失败,没有明显的原因。而且每次都是不同的随机包。

CI 位于 AWS 机器上,所以我认为这不是互联网问题

失败看起来与此类似(不同的包失败):

Collecting django-rest-auth==0.9.3 (from -r requirements.txt (line 7))
Could not find a version that satisfies the requirement django-rest-auth==0.9.3 (from -r requirements.txt (line 7)) (from versions: )
No matching distribution found for django-rest-auth==0.9.3 (from -r requirements.txt (line 7))

Or

Collecting py>=1.5.0 (from pytest->-r requirements.txt (line 15))
Could not find a version that satisfies the requirement py>=1.5.0 (from pytest->-r requirements.txt (line 15)) (from versions: )
No matching distribution found for py>=1.5.0 (from pytest->-r requirements.txt (line 15))

编辑:尝试添加--timeout 30 --retries 15这似乎没有改变任何东西


当我有严重依赖时,我遇到了这个问题,所以我更新了 pip 的超时并解决了问题。即我的 .pip/pip.conf 超时为 30 秒

[global]
timeout = 30
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

PIP 随机失败“无法找到满足要求的版本”,且具有相同的requirements.txt 的相关文章

随机推荐