python下载第三方库超时问题解决
在安装第三方库的时候,Python报错pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host=‘files.pythonhosted.org’, port=443): Read timed out.
解决方法
输入指令
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/
目前还是豆瓣的下载速度最有保障。
还没有评论,来说两句吧...