详细报错如下
pip install -r ../requirements.txt
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/
ERROR: Could not find a version that satisfies the requirement django_redis==4.8.0 (from versions: none)
ERROR: No matching distribution found for django_redis==4.8.0
[notice] A new release of pip is available: 23.2.1 -> 25.0.1
[notice] To update, run: pip install --upgrade pip
如果只有个别包这样的报错,那么可能是包的版本报错了。
但是如果所有的包都报错这个,那么只有两种可能,都是比较难想到的点。
一是Python/pip 版本不对
可能你的Pip 不是3版本的,这时可以 先 python -V 确认python版本,然后把pip 命令明确改成 python -m pip
的方式,这也是官方推荐的做法。
二是pip的源挂了,被封了
这个网址是在打印报错的最上方输出的。估计是公司其他用户有意或者无意导致了ip被封,一个老鼠坏了一锅粥。
这时只能永久更换源或者临时更换。
pip install -r ../requirements.txt -i https://mirrors.aliyun.com/pypi/simple/