PIP not working - proxy - Connection aborted

2020-02-15 02:58发布

问题:

I am trying to install python packages behind a proxy and I get the following error:

pip --proxy="user:pass@address:port" install bokeh

Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', BadStatusLine("''",))': /simple/bokeh/

What do you think is going wrong?

回答1:

SOLVED The issue was that my dorm firewall is blocking pip (pypi.python.org). Issuing the same command at work installs python packages correctly.



回答2:

When a proxy terminates a HTTPS connection. It can't send back headers, because it can't read the encrypted data going back and forth, so it sends back the empty string "". httplib attempts to parse "" as "HTTP/1.x " and fails with the above message.

https://github.com/requests/requests/issues/2364

You may want to see this post on how to setup PIP behind a proxy. Are you able to get any pip installs to work or is this the only one giving you a problem?

Using pip behind a proxy



回答3:

I had the same problem with MEO in Por

I changed my IPv4 DNS to 8.8.8.8 and 8.8.4.4 (Google) and disabled IPv6 and it worked.



标签: pip