pip 下载模块时经常遇到timeout错误:
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host=‘files.pythonhosted.org’, port=443): Read timed out.
一般用以下3种方式处理:
1.修改超时时间
pip --default-timeout=100 install xxx
2.设置下载源
https://www.cnblogs.com/sunnydou/p/5801760.html
可以修改默认下载源,可以写成脚本的形式
pip install xxx -i http://pypi.mirrors.ustc.edu.cn/simple --trusted-host pypi.mirrors.ustc.edu.cn
3.直接下载文件之后在安装
pip install (path)/pip-8.1.2-py2.py3-none-any.whl