python使用pip/pip3安装第三方模块报错
python3 安装第三方模块时出现以下错误时:
requests.packages.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host=‘files.pythonhosted.org’, port=443): Read timed out.
多半是网络不好,任务超时了,毕竟是国外的源,访问很慢,所以换成清华源会快很多。
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple ModuleName
将你要安装的模块名替换掉 ModuleName 即可
如我要安装 python-docx
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple python-doxc
参考:https://blog.csdn.net/cfan927/article/details/103332109