我们在使用Pip的时候,经常会因为访问源的问题而报错:HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out。
其实很简单,我们只需要将源切换成国内源即可。
首先通过以下命令创建配置文件:
mkdir ~/.pip
vim ~/.pip/pip.conf
然后在配置文件中配置源:
[global]
timeout = 6000
index-url = http://mirrors.aliyun.com/pypi/simple/
trusted-host = mirrors.aliyun.com
这样就可以发现速度快多了,哈哈。
![](http://www.wingmei.cn/wp-content/uploads/2019/11/QQ20191129-144149@2x-1024x183.png)
文章评论