python
network_error
ai_generated
true
错误:pip._vendor.requests.exceptions.JSONDecodeError:期望值:第1行第1列(字符0)
ERROR: pip._vendor.requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
ID: python/pip-json-decoding-error
80%修复率
85%置信度
0证据数
2025-02-14首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 3.8 | active | — | — | — |
| 3.9 | active | — | — | — |
根因分析
pip 从包索引收到空响应或非 JSON 响应,通常是由于网络问题或索引 URL 配置错误。
English
Pip receives an empty or non-JSON response from a package index, often due to network issues or misconfigured index URL.
解决方案
-
90% 成功率 Check the index URL for correctness
Run: pip install -i https://pypi.org/simple/ package (ensure URL ends with /simple)
-
85% 成功率 Use a different index or mirror
Run: pip install -i https://pypi.tuna.tsinghua.edu.cn/simple package
无效尝试
常见但无效的做法:
-
Retrying with the same index URL
90% 失败
The index URL may be broken; retries won't fix it.
-
Using a different HTTP method like POST
80% 失败
Pip uses GET; changing method is not supported.