Skip to content

Installing or Updating pip Packages from Behind Proxies⚓︎

Issue⚓︎

When a Linux system has Python installed, and access to the internet requires usage of a proxy, you must export the proxy settings before you can install and update pip packages.

Text Only
1
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f68d4312e50>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /simple/pip/

Fix⚓︎

Bash
1
2
3
export http_proxy="http://proxy.company.com:3128"
export https_proxy="http://proxy.company.com:3128"
python3 -m pip install pip --upgrade --user

Note: http_proxy and https_proxy are used by many applications. If you set these to update pip, you may want to unset them after updating to prevent all applications from utilizing the proxy.


References⚓︎