# 警告：连接被 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x...>，'连接到 pypi.org 超时。（连接超时=15）')' 中断后重试（Retry(total=4, ...)）：/simple/requests/

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

## 根因

到 pypi.org 的网络出口被阻止或较慢（防火墙、VPN、DNS），因此每次连接尝试在 HTTP 握手完成前就超时。

## 版本兼容性

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

## 解决方案

1. **** (92% 成功率)
   ```
   export PIP_INDEX_URL=https://mirror.corp.example/simple
export PIP_TRUSTED_HOST=mirror.corp.example
python -m pip install requests
   ```
2. **** (88% 成功率)
   ```
   export HTTPS_PROXY=http://proxy.corp.example:3128
export HTTP_PROXY=http://proxy.corp.example:3128
python -m pip install requests
   ```

## 无效尝试

- **** — If the host is unreachable, a longer timeout just makes the failure slower. (80% 失败率)
- **** — More retries on a blocked route amplify the delay without success. (85% 失败率)
