Python报错ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

在安装第三方库的时候,Python报错:

ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

解决方法如下:

输入指令:

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

如果上面阿里云镜像不行的话,可以换成下面的国内镜像网站

清华: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/

原文地址:https://www.cnblogs.com/ring1992/p/13971119.html