python network_error ai_generated true

pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

ID: python/pip-connection-timeout-read-timeout

Also available as: JSON · Markdown · 中文
80%Fix Rate
87%Confidence
0Evidence
2024-08-14First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.x active

Root Cause

Slow or unstable network, or a proxy throttling large wheel downloads.

generic

中文

网络缓慢或不稳定,或代理对大型 wheel 下载进行限速。

Workarounds

  1. 90% success
    pip install --timeout 120 --retries 5 foo
  2. 85% success
    mkdir -p ~/.pip
    cat > ~/.pip/pip.conf <<'EOF'
    [global]
    timeout = 120
    retries = 5
    EOF
    pip install foo

Dead Ends

Common approaches that don't work:

  1. 60% fail

    Bypasses cache but does not address slow network; may worsen by re-downloading dependencies.

  2. 70% fail

    Same timeout will recur; retries waste bandwidth.