/ python

python开了代理后执行pip报错 (SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))

问题背景

windows环境下,开了代理以后,执行python的pip命令,或者其他任何与网络有关的命令,都报错:

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:1129)'))': /simple/urllib3/
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:1129)'))': /simple/urllib3/
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:1129)'))': /simple/urllib3/
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:1129)'))': /simple/urllib3/

python-pip-ssleoferror-with-vpn

解决方法

最简单的解决方法

关掉vpn

一劳永逸的方法

  • 1). 关掉vpn
  • 2). 安装就版本的urllib3
pip install urllib3==1.25.11
  • 3). 打开vpn

搞定。