[英]SSL Issue while installing any package using pip behind the proxy
在安裝tensorflow或代理后面的任何其他軟件包時遇到的問題:
第一次嘗試 :
運行命令:
pip install --upgrade tensorflow
輸出:
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was
forcibly closed by the remote host', None, 10054, None))': /simple/tensorflow/
第二次嘗試:
然后我提供了代理詳細信息以及命令
>pip install --upgrade tensorflow --proxy http://user:passwd@xxx.xx.x.xx:80
輸出錯誤:
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:83
3)'),)': /simple/tensorflow/
在pip安裝上建議的第三次嘗試失敗,並顯示“連接錯誤:[SSL:CERTIFICATE_VERIFY_FAILED]證書驗證失敗(_ssl.c:598)” :
pip install --upgrade tensorflow --trusted-host pypi.org --trusted-host files.pythonhosted.org --proxy http://user:passwd@xxx.xx.x.xx:80
輸出:
同上。
誰能幫忙??
編輯:在Windows機器上工作
我懷疑您可能需要在計算機上設置代理環境變量才能使用代理。 嘗試設置以下內容(假設您在Linux或Mac OS上):
export HTTP_PROXY=http://user:passwd@xxx.xx.x.xx:80
export HTTPS_PROXY=https://user:passwd@xxx.xx.x.xx:443
您不一定需要設置HTTPS_PROXY
變量,但這樣做沒有什么害處
然后嘗試在沒有標志的情況下運行
pip install tensorflow
在pip和apt之間進行一些更新混淆后,我遇到了類似的問題。 按照一些我不記得的SO頁面上的建議,我已經啟動了
sudo python -m easy_install --upgrade pyOpenSSL
並讓事情再次運行。
LE:可能誤解了問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.