# 警告：重试（Retry(total=4, connect=None, read=None, redirect=None, status=None)），因为连接中断：'ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted.org', port=443): 读取超时（read timeout=15）")'

- **ID:** `python/pip-connection-timeout-pypi`
- **领域:** python
- **类别:** network_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

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

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.x | active | — | — |

## 解决方案

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

## 无效尝试

- **** — The underlying network latency is unchanged; retries hit the same timeout. (80% 失败率)
- **** — Trusted-host only disables TLS verification; it does not affect read timeouts. (90% 失败率)
- **** — Removes retries but the first attempt still times out. (85% 失败率)
