当使用 pip install <package>
安装库时,会出现:
raise ReadTimeoutError(self._pool, None, ‘Read timed out.’)
ReadTimeoutError: HTTPSConnectionPool(host=‘files.pythonhosted.org’, port=443): Read timed out.
解决方法:
-
延长timeout的时间
pip --default-timeout=100 install <package>
-
临时换源
以清华源为例
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple <package>
-
阿里云:
http://mirrors.aliyun.com/pypi/simple/
-
中国科技大学:
https://pypi.mirrors.ustc.edu.cn/simple/
-
豆瓣:
http://pypi.douban.com/simple/
-
清华大学:
https://pypi.tuna.tsinghua.edu.cn/simple/
-
中国科学技术大学:
http://pypi.mirrors.ustc.edu.cn/simple/