一招解决python pip install 安装库失败
pythonan安装matplotlib由于使用默认的pip源死活就是安装不上,总是说出错,其实就是连接超时,下载不了安装包,原因是没有科学上网的工具
以下是搜集了一些国内的pip源
阿里云 http://mirrors.aliyun.com/pypi/simple/

中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/

豆瓣(douban) http://pypi.douban.com/simple/

清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/

中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/

最终解决办法:pip install matplotlib -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pythonan安装matplotlib这样下载的速度简直就是光速,解决了之前链接超时,半天下载不成功的问题

pythonan安装matplotlib下载之后可以用代码 python -m pip list 检查matplotlib是否安装成功,若出现上述matplotlib字样和版本号就是安装成功
pythonan安装matplotlib也可以在IDLE中import matplotlib 若不报错就是安装成功

注意:由于之前用的python的版本是3.9的,怎么安装matplotlib都是报错,经过上网搜索了解到python的版本并不是越高越好,会出现版本不兼容的问题。所以后来改用python 3.7版本,就没有出现问题。

相关文章:

  • 2021-10-19
  • 2021-11-20
  • 2021-07-07
  • 2021-03-30
  • 2021-09-18
  • 2021-11-04
  • 2021-09-24
猜你喜欢
  • 2021-11-03
  • 2021-11-07
  • 2022-01-01
  • 2021-07-05
相关资源
相似解决方案