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)

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

精彩文章

评论可见,请评论后查看内容,谢谢!!!
 您阅读本篇文章共花了: