作者热门文章
- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
作为 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/
我是一名优秀的程序员,十分优秀!