python
network_error
ai_generated
true
警告:重试(Retry(total=4, connect=None, read=None, redirect=None, status=None)),因为连接中断:'ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted.org', port=443): 读取超时(read timeout=15)")'
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
80%修复率
88%置信度
0证据数
2025-05-09首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 3.x | active | — | — | — |
根因分析
到 files.pythonhosted.org 的网络延迟或连接缓慢/被阻断,超出 pip 默认读取超时,导致反复重试并最终失败。
English
Network latency or a slow/blocked connection to files.pythonhosted.org exceeds pip's default read timeout, causing repeated retries and eventual failure.
解决方案
-
85% 成功率
Increase timeouts and retries: pip install --timeout 120 --retries 10 package
-
90% 成功率
Use a faster mirror: pip install -i https://pypi.tuna.tsinghua.edu.cn/simple package
-
88% 成功率
Configure globally: pip config set global.timeout 120 && pip config set global.index-url https://pypi.org/simple
无效尝试
常见但无效的做法:
-
80% 失败
The underlying network latency is unchanged; retries hit the same timeout.
-
90% 失败
Trusted-host only disables TLS verification; it does not affect read timeouts.
-
85% 失败
Removes retries but the first attempt still times out.