python
install_error
ai_generated
true
错误:无法安装 package1==1.0 和 package2==2.0,因为这些包版本存在冲突的依赖关系。
ERROR: Cannot install package1==1.0 and package2==2.0 because these package versions have conflicting dependencies.
ID: python/pip-conflict-with-requirements
80%修复率
83%置信度
0证据数
2024-05-20首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 3.8 | active | — | — | — |
| 3.9 | active | — | — | — |
| 3.10 | active | — | — | — |
| 3.11 | active | — | — | — |
| 3.12 | active | — | — | — |
根因分析
两个或多个包需要不兼容版本的公共依赖。
English
Two or more packages require incompatible versions of a common dependency.
解决方案
-
80% 成功率
pip install package1 package2 --upgrade --constraint constraints.txt
-
85% 成功率
python -m venv venv && source venv/bin/activate && pip install package1==1.1 package2==1.9
无效尝试
常见但无效的做法:
-
70% 失败
Ignores the conflict but may cause runtime errors due to missing or wrong dependency versions.
-
90% 失败
The conflict remains; pip will still raise the error when resolving the full set.