pip._vendor.urllib3.exceptions.ReadTimeoutError

使用pip安装第三方库时遇到: pip._vendor.urllib3.exceptions.ReadTimeoutError HTTPSConnectionPool(host=files.pythonhosted.org port=443) Read timed out ,这种一般是网络不佳所致

解决

第一种

pip3 install xxxx 后面加上 -i 镜像地址
国内主要镜像地址:

1
2
3
4
5
6
清华: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/

比如安装 pipenv

1
pip3 install pipenv -i https://pypi.tuna.tsinghua.edu.cn/simple

第二种

用电脑连接手机热点

然后重新 pip3 install xxxx