gpt4 book ai didi

python - PIP 随机失败 'Could not find a version that satisfies the requirement' 相同要求.txt

转载 作者:太空狗 更新时间:2023-10-29 20:40:15 24 4
gpt4 key购买 nike

作为 CI 测试的一部分,我们安装了一个 virtualenv,其中包含来自常量 requirements.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))

或者

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

关于python - PIP 随机失败 'Could not find a version that satisfies the requirement' 相同要求.txt,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56596752/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com