python install_error ai_generated true

错误:无法安装 package==1.0 和 package==2.0,因为这些包版本存在冲突的依赖关系。

ERROR: Cannot install package==1.0 and package==2.0 because these package versions have conflicting dependencies.

ID: python/pip-requirement-already-satisfied-conflict

其他格式: JSON · Markdown 中文 · English
80%修复率
87%置信度
0证据数
2024-10-01首次发现

版本兼容性

版本状态引入弃用备注
3.x active

根因分析

用户明确请求了同一包的两个互斥版本,或者某个依赖要求与固定版本不兼容的版本。

English

The user explicitly requested two mutually exclusive versions of the same package, or a dependency requires a version incompatible with the pinned one.

generic

解决方案

  1. 85% 成功率
    pip install package==2.0  # then update other packages as needed
  2. 80% 成功率
    echo 'package==2.0' > constraints.txt; pip install -c constraints.txt other-package

无效尝试

常见但无效的做法:

  1. 95% 失败

    Does not resolve version conflict; the resolver still cannot satisfy both constraints.

  2. 90% 失败

    pip will not install conflicting versions; the command exits with an error.