python安装matplotlib包报错:ERROR: Could not find a version that satisfies the requirement matplotlib

python安装matplotlib包报错:ERROR: Could not find a version that satisfies the requirement matplotlib (from versions: none)ERROR 以及其他ERROR: Could not find a version that satisfies the requirement xxx包 (from versions: none)的解决方案

遇到的问题

一个项目需要用到matplotlib包,但是发现之前没有安装过,故习惯性按照如下方法尝试安装

file->setting->project:项目名>python interpreter->搜索 matplotlib->install->报错 ERROR: Could not find a version that satisfies the requirement matplotlib (from versions: none)ERROR

结果报错版本不匹配。。下面开始找解决方法

失败的过程

不知道是不是pip的问题?尝试更新pip

打开安装py的可执行文件的位置,然后

python.exe -m pip install --upgrade pip -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

已经是最新了,看来和pip版本没关系

考虑国内的网络情况,用镜像源发现可以连接到,但是网速只有0.1kb/s,没办法只能再换

pip install 包名 -i -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
(忘记截图了这里)

最终解决方案

最后找到了清华的镜像,这次很快啊,瞬间下载完成

pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple matplotlib

附上成功截图

举一反三

看来主要原因还是网络问题,需要找一个靠谱的镜像。经过此次教训,诸如此类报错:ERROR: Could not find a version that satisfies the requirement xxx包 (from versions: none)
只需使用清华镜像https://pypi.tuna.tsinghua.edu.cn,运行
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple xxx包名
即可

参考

ERROR: Could not find a version that satisfies the requirement matplotlib (from versions: none)

特别感谢清华大学开源软件镜像站

文章出处登录后可见!

已经登录?立即刷新

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
扎眼的阳光的头像扎眼的阳光普通用户
上一篇 2023年10月17日
下一篇 2023年10月17日

相关推荐