PIP安裝軟件報錯:“ERROR: Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443)”


遇到問題

最近PIP安裝軟件總是報錯,報錯提示如下:

1.WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001E6D75D4220>, 'Connection to files.pythonhosted.org timed out.

2.ERROR: Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/91/d2/30ecd905746d1fee4004daae3f0051bf4b305bee1fe578bd7d1ea712d571/Pillow-7.2.0-cp38-cp38-win_amd64.whl (Caused by ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001E6D75D4970>, 'Connection to files.pythonhosted.org timed out. (connect timeout=15)'))

如圖:

解決辦法:

以管理員身份運行cmd,cd至python Scripts目錄,我的安裝在"D:\Program Files\Python38\Scripts",將pip install xxx命令調整如下即可:

pip install xxx  -i http://pypi.douban.com/simple --trusted-host pypi.douban.comxxx為要安裝的軟件,如

安裝pillow軟件pip install pillow -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

安裝robotframework-ride軟件pip install robotframework-ride  -i http://pypi.douban.com/simple --trusted-host pypi.douban.com


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM