# 错误：JSON对象必须是str、bytes或bytearray，而不是'NoneType'

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

## 根因

PyPI索引服务器返回了空或非JSON响应，通常由于网络问题或服务器错误。

## 版本兼容性

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

## 解决方案

1. **Use a different index or mirror** (85% 成功率)
   ```
   pip install package -i https://pypi.douban.com/simple/
   ```
2. **Check network connectivity and proxy settings** (80% 成功率)
   ```
   curl https://pypi.org/simple/package/
# If fails, configure proxy: pip install --proxy http://proxy:port package
   ```

## 无效尝试

- **Retrying with --retries=10** — Server issue may persist; retries don't fix malformed response. (80% 失败率)
- **Using --no-cache-dir** — Cache is not the cause; server response is invalid. (90% 失败率)
