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)

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

原文地址:https://blog.csdn.net/Voyager_Xie/article/details/132677885

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任

如若转载,请注明出处:http://www.7code.cn/show_35490.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注