python network_error ai_generated true

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. (read timeout=15)")'

ID: python/pip-connection-timeout-pypi

Also available as: JSON · Markdown · 中文
80%Fix Rate
88%Confidence
0Evidence
2025-05-09First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.x active — — —

Root Cause

Network latency or a slow/blocked connection to files.pythonhosted.org exceeds pip's default read timeout, causing repeated retries and eventual failure.

generic

中文

到 files.pythonhosted.org 的网络延迟或连接缓慢/被阻断,超出 pip 默认读取超时,导致反复重试并最终失败。

Workarounds

  1. 85% success
    Increase timeouts and retries: pip install --timeout 120 --retries 10 package
  2. 90% success
    Use a faster mirror: pip install -i https://pypi.tuna.tsinghua.edu.cn/simple package
  3. 88% success
    Configure globally: pip config set global.timeout 120 && pip config set global.index-url https://pypi.org/simple

Dead Ends

Common approaches that don't work:

  1. 80% fail

    The underlying network latency is unchanged; retries hit the same timeout.

  2. 90% fail

    Trusted-host only disables TLS verification; it does not affect read timeouts.

  3. 85% fail

    Removes retries but the first attempt still times out.