python install_error ai_generated partial

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

Also available as: JSON · Markdown · 中文
80%Fix Rate
86%Confidence
0Evidence
2024-05-08First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.x active

Root Cause

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

generic

中文

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

Workarounds

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

Dead Ends

Common approaches that don't work:

  1. 85% fail

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

  2. 70% fail

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

  3. 60% fail

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