python install_error ai_generated partial

错误:无法安装 package-a==1.0 和 package-b==2.0,因为这些包版本的依赖项存在冲突。 冲突由以下原因引起: 用户请求 package-a==1.0 package-b 2.0 依赖于 package-a<1.0

ERROR: Cannot install package-a==1.0 and package-b==2.0 because these package versions have conflicting dependencies. The conflict is caused by: The user requested package-a==1.0 package-b 2.0 depends on package-a<1.0

ID: python/pip-resolution-too-deep-backtracking

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

版本兼容性

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

根因分析

依赖图无法满足:两个固定版本的需求传递性地要求共享包的互不兼容版本。

English

The dependency graph is unsatisfiable: two pinned requirements transitively require incompatible versions of a shared package.

generic

解决方案

  1. 90% 成功率
    pip install 'package-a>=0.9,<1.0' 'package-b==2.0'
  2. 85% 成功率
    pip install --dry-run --report report.json package-a==1.0 package-b==2.0
    python -m json.tool report.json | less

无效尝试

常见但无效的做法:

  1. 85% 失败

    Force install does not resolve version conflicts; pip still refuses to pick a solution.

  2. 70% 失败

    The legacy resolver may install an inconsistent set, leading to runtime ImportErrors later.

  3. 60% 失败

    Unpinned installs may still conflict on transitive constraints and reproduce the error.