Python 一个 pip 报错 ProxyError 的处理
Windows 环境下,在 IE 中设置的代理 (连接-局域网设置) 是全局的,在 cmd 的命令也会使用那个代理。
遇到的问题
D:\pentest_tmp>python2 -m pip install prettytable
Collecting prettytable
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x00000000046A9E48>: Failed to establish a new connection: [Errno 10061] ',))': /simple/prettytable/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x00000000046A9748>: Failed to establish a new connection: [Errno 10061] ',))': /simple/prettytable/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x00000000046A9FD0>: Failed to establish a new connection: [Errno 10061] ',))': /simple/prettytable/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x00000000046A94E0>: Failed to establish a new connection: [Errno 10061] ',))': /simple/prettytable/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x00000000046A9C18>: Failed to establish a new connection: [Errno 10061] ',))': /simple/prettytable/
解决方法
关闭 IE 设置中的代理。
Leave a Reply