pip network_error ai_generated true

WARNING: Retrying (Retry(total=0)) after connection broken by 'ProxyError': Cannot connect to proxy

ID: pip/proxy-error

Also available as: JSON · Markdown
82%Fix Rate
85%Confidence
50Evidence
2022-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
24 active

Root Cause

Pip cannot connect through the configured HTTP/HTTPS proxy. Common in corporate environments where proxy settings are misconfigured, proxy requires authentication, or the proxy server is down.

generic

Workarounds

  1. 88% success Set correct proxy with authentication: pip install --proxy http://user:pass@proxy:port <package>
    export HTTPS_PROXY=http://user:pass@proxy:port && pip install <package>
  2. 85% success Configure pip.conf with proxy settings permanently
    Add [global] proxy = http://user:pass@proxy:port to ~/.config/pip/pip.conf
  3. 82% success Use no_proxy to bypass proxy for internal PyPI mirrors
    export no_proxy=internal-pypi.company.com && pip install -i https://internal-pypi.company.com/simple/ <package>

Dead Ends

Common approaches that don't work:

  1. Set --trusted-host to bypass proxy SSL 80% fail

    trusted-host only skips certificate verification for the index; it does not fix proxy connectivity issues

  2. Unset all proxy environment variables 60% fail

    In corporate networks, removing proxy settings means no internet access at all

Error Chain

Leads to:
Preceded by:
Frequently confused with: