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