python
config_error
ai_generated
true
错误:用户请求package==1.0,但extra index URL上提供了package==2.0
ERROR: The user requested package==1.0 but package==2.0 is available on the extra index URL
ID: python/pip-extra-index-url-conflict
80%修复率
87%置信度
0证据数
2025-06-10首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 3.11 | active | — | — | — |
根因分析
使用多个索引时,pip可能在额外索引上找到不同版本,与指定版本冲突。
English
When using multiple indexes, pip may find a different version on an extra index and conflict with the specified version.
解决方案
-
85% 成功率
pip install --index-url https://main.index package==1.0
-
80% 成功率
pip install --extra-index-url https://extra.index package==1.0
-
90% 成功率
echo 'package==1.0' > constraints.txt && pip install -c constraints.txt package
无效尝试
常见但无效的做法:
-
60% 失败
May lose access to needed packages.
-
70% 失败
Disables all indexes, may not find package.
-
80% 失败
Doesn't resolve version conflict.