Guo Qiang

Python 开了代理后执行报错

发布日期 2023-04-11 11:46:10已读 637 次FAQ
image

Windows 环境下,开了 vpn 代理后,不论执行 py 代码还是 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/


解决办法就是安装版本号:1.25.11 的 urllib3


1. 关掉 vpn
2. pip install urllib3==1.25.11
3. 打开 vpn


Copyright © 2019~2024 Guo Qiang
Pages viewed 30,423,695