记一次pip下载包报错ERROR: No matching distribution found for xxx时的解决方案

前言

当我们使用python自带的pip安装一些包时,可能会报以下错误:
在这里插入图片描述
出现这种情况有三种可能:

第一种可能:

pip的版本过低,需要升级一下,可以执行以下命令进行尝试

 python -m pip install --upgrade pip

第二种可能:

考虑可能是网速的原因,这时可以采用国内的镜像源来加速

 pip install 包 -i https://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host pypi.douban.com
 
 ps :--trusted-host pypi.douban.com 这是为了获得ssl证书的认证
	常见pip镜像源(国内源)
	清华:https://pypi.tuna.tsinghua.edu.cn/simple
	阿里云:http://mirrors.aliyun.com/pypi/simple/
	中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
	华中理工大学:http://pypi.hustunique.com/
	山东理工大学:http://pypi.sdutlinux.org/
	豆瓣:http://pypi.douban.com/simple/

第三种可能:

检查下是否开启代理或者VPN,将其关闭再使用国内镜像进行尝试看看是否可以解决,我这边就是代理开启导致网络太慢而报错的。

猜你喜欢

转载自blog.csdn.net/weixin_44011409/article/details/129482559