1. 程式人生 > >Python 安裝第三方庫

Python 安裝第三方庫

解決 ffffff ssl ppi all cau was nbsp bsp

cmd進入Python安裝路徑scripts文件夾

>pip install requests

報錯:

Collecting requests
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)‘),)‘: /simple/requests/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)‘),)‘: /simple/requests/


Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)‘),)‘: /simple/requests/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)‘),)‘: /simple/requests/

Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)‘),)‘: /simple/requests/
Could not fetch URL https://pypi.python.org/simple/requests/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=‘pypi.python.org‘, port=443): Max retries exceeded with url: /simple/requests/ (Caused by SSLError(SSLError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)‘),)) - skipping

Could not find a version that satisfies the requirement requests (from versions: )

技術分享圖片

原因:查找網上的解釋是網速太慢,或被墻了。

解決辦法:使用國內鏡像加速。

>pip install requests -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

技術分享圖片

問題解決。

Python 安裝第三方庫