首页 > 解决方案 > 无法使用 pip 21.0.1 SSLEOFError 安装任何软件包

问题描述

我在 Ubuntu1604 上使用带有 pip 21.0.1 的 python 3.7。我无法安装任何带有错误的python包

yc_qian@NiBaBa:~$ pip install pyopenssl
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
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:1076)'))': /simple/pyopenssl/
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:1076)'))': /simple/pyopenssl/
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:1076)'))': /simple/pyopenssl/
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:1076)'))': /simple/pyopenssl/
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:1076)'))': /simple/pyopenssl/
Could not fetch URL https://pypi.tuna.tsinghua.edu.cn/simple/pyopenssl/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.tuna.tsinghua.edu.cn', port=443): Max retries exceeded with url: /simple/pyopenssl/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1076)'))) - skipping
ERROR: Could not find a version that satisfies the requirement pyopenssl
ERROR: No matching distribution found for pyopenssl
Could not fetch URL https://pypi.tuna.tsinghua.edu.cn/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.tuna.tsinghua.edu.cn', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1076)'))) - skipping

我在github上发现了类似的问题,但不知道如何解决。我也尝试降级pip,但是命令也使用pip,所以遇到了同样的错误......

我该如何解决这个问题?

标签: pythonpip

解决方案


根据菲利克斯在这里提到的答案,我解决了这个问题

unset http_proxy https_proxy

推荐阅读