pip/pip3 install 报错 “Could not find a version that satisfies the requriement xxx” 的解决方法

一、问题描述

pip/pip3 install 报错 “Could not find a version that satisfies the requriement xxx”,如下图:

二、排查思路

1、检查网络配置

我尝试了yum和wget也出现了错误,由此发现是网络问题。检查网络配置文件,原来是忘记了配置DNS。

 

2、是否pip版本过低

如果是pip版本过低,可以使用下面的命令升级pip:

python -m pip install --upgrade pip

 

3、尝试更换源

如果前两种思路仍然没有解决问题,可以尝试更换成国内的镜像源,例如:

pip install 包名 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

猜你喜欢

转载自blog.csdn.net/wxt_hillwill/article/details/114657259