# 错误：pip._vendor.requests.exceptions.JSONDecodeError：期望值：第1行第1列（字符0）

- **ID:** `python/pip-json-decoding-error`
- **领域:** python
- **类别:** network_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

pip 从包索引收到空响应或非 JSON 响应，通常是由于网络问题或索引 URL 配置错误。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.8 | active | — | — |
| 3.9 | active | — | — |

## 解决方案

1. **Check the index URL for correctness** (90% 成功率)
   ```
   Run: pip install -i https://pypi.org/simple/ package (ensure URL ends with /simple)
   ```
2. **Use a different index or mirror** (85% 成功率)
   ```
   Run: pip install -i https://pypi.tuna.tsinghua.edu.cn/simple package
   ```

## 无效尝试

- **Retrying with the same index URL** — The index URL may be broken; retries won't fix it. (90% 失败率)
- **Using a different HTTP method like POST** — Pip uses GET; changing method is not supported. (80% 失败率)
