簡體   English   中英

python pip 安裝給出 ssl 證書錯誤

[英]python pip install gives ssl Certificate error

我收到 SSSL 證書錯誤:我嘗試--trusted-host以及我在谷歌搜索時可以找到的所有其他選項,但我無法弄清楚為什么會出現錯誤。

當我以root旁邊的其他用戶身份運行時出現錯誤。

(vmware) [user@machine vmware]$ pip3 install --upgrade pip --trusted-host files.pythonhosted.org --trusted-host pypi.org --trusted-host pypi.python.org
Requirement already satisfied: pip in ./lib/python3.6/site-packages (21.3.1)
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:877)'),)': /simple/pip/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:877)'),)': /simple/pip/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:877)'),)': /simple/pip/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:877)'),)': /simple/pip/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:877)'),)': /simple/pip/
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:877)'),)) - skipping

但是當我以 root 身份運行相同的命令時,我沒有收到錯誤。

(vmware) [user@machine vmware]$ sudo pip3 install --upgrade pip --trusted-host files.pythonhosted.org --trusted-host pypi.org --trusted-host pypi.python.org
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting pip
  Downloading https://files.pythonhosted.org/packages/a4/6d/6463d49a933f547439d6b5b98b46af8742cc03ae83543e4d7688c2420f8b/pip-21.3.1-py3-none-any.whl (1.7MB)
    100% |████████████████████████████████| 1.7MB 11.6MB/s
Installing collected packages: pip
Successfully installed pip-21.3.1

我知道完整的問題是什么,但我做了什么來解決它,我直接在我的家里創建了一個 pip.conf,其中包含受信任的主機變量及其值,如上所述。 然后注銷並重新登錄以再次獲取它並開始工作。 感謝所有提供幫助的人,非常感謝。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM