python network_error ai_generated true

警告:连接因 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x...>: Failed to establish a new connection: [Errno 111] Connection refused')' 中断,正在重试(Retry(total=4, connect=None, read=None, redirect=None, status=None))

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x...>: Failed to establish a new connection: [Errno 111] Connection refused')'

ID: python/pip-extra-index-unreachable

其他格式: JSON · Markdown 中文 · English
80%修复率
87%置信度
0证据数
2024-10-21首次发现

版本兼容性

版本状态引入弃用备注
3.8 active — — —
3.9 active — — —
3.10 active — — —
3.11 active — — —
3.12 active — — —

根因分析

pip 配置了一个在当前网络上无法访问的额外索引 URL,导致在回退前反复重试。

English

pip is configured with an extra index URL that is unreachable from the current network, causing retries before falling back.

generic

解决方案

  1. 90% 成功率
    pip config unset global.extra-index-url  # or edit ~/.config/pip/pip.conf
  2. 85% 成功率
    pip install --index-url https://pypi.org/simple <package>

无效尝试

常见但无效的做法:

  1. 90% 失败

    More retries just delay the same connection failure.

  2. 95% 失败

    The connection is refused immediately; timeout is not the issue.

  3. 90% 失败

    pip itself is fine; the configured index URL is the problem.