python下载第三方库超时问题解决

以你之姓@ 2023-01-08 03:26 214阅读 0赞

在安装第三方库的时候,Python报错pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host=‘files.pythonhosted.org’, port=443): Read timed out.

解决方法

输入指令

  1. pip --default-timeout=100 install 库名称 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

pycharm 更改镜像地址

File —>Settings–>project Interpreter
在这里插入图片描述在这里插入图片描述在这里插入图片描述在这里插入图片描述
如果上面那个豆瓣依然不快(虽然还没出现过这种情况),可以换成下面的国内镜像网站。

清华:https://pypi.tuna.tsinghua.edu.cn/simple 阿里云:http://mirrors.aliyun.com/pypi/simple/

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

山东理工大学:http://pypi.sdutlinux.org/ 豆瓣:http://pypi.douban.com/simple/

目前还是豆瓣的下载速度最有保障。

发表评论

表情:
评论列表 (有 0 条评论,214人围观)

还没有评论,来说两句吧...

相关阅读