GIS数据共享:官方网站

python

当前位置:首页 > language > python

python pip安装库超时( ConnectTimeoutError)

现象: 会出现如图所示类似的超时报错:ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host='files.pythonhosted.org', port...

现象:

 会出现如图所示类似的超时报错:


ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/86/cd/619a45613393293117297f2f0e5086a619e1ea98c5e2ce6d0f554ddc97c3/matplotli

b-3.5.1-cp39-cp39-win_amd64.whl (Caused by ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000002C5D01673D0>, 'Connection to files.pythonhosted.org timed out. (connect timeout=15)'))


原因:

一般情况下pip出现ReadTimeoutError的情况,是由于我们下载的是国外的包,下载速度较慢,从而导致超时,所以一般遇到这种问题,我们可以选择国内的镜像来解决问题。


解决:

使用国内镜像仓库:


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

阿里云:http://mirrors.aliyun.com/pypi/simple/

中科大镜像:https://pypi.mirrors.ustc.edu.cn/simple/

豆瓣镜像:http://pypi.douban.com/simple/

中科大镜像2:http://pypi.mirrors.ustc.edu.cn/simple/


使用:

#示例如下:
 
pip install matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple/

结果:

扫码查看

相关内容

文章评论

表情

共 0 条评论,查看全部
  • 这篇文章还没有收到评论,赶紧来抢沙发吧~

评论排行榜

热门标签