python install_error ai_generated true

ERROR: Cannot install foo==1.2.3 and bar==4.5.6 because these package versions have conflicting dependencies.

ID: python/pip-no-matching-distribution-with-constraints

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

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.8 active — — —
3.9 active — — —
3.10 active — — —
3.11 active — — —
3.12 active — — —

Root Cause

The new pip resolver found no assignment of transitive dependency versions that satisfies all declared version constraints simultaneously.

generic

中文

新版 pip 解析器找不到一组传递依赖版本能同时满足所有声明的版本约束。

Workarounds

  1. 90% success
    Install pip-tools and let it compute a consistent set: `pip install pip-tools && pip-compile requirements.in` then `pip-sync`.
  2. 88% success
    Ask pip to explain: `pip install foo==1.2.3 bar==4.5.6 -v` and read the 'The conflict is caused by:' block, then relax one upper bound.

Dead Ends

Common approaches that don't work:

  1. 80% fail

    Installs incompatible transitive deps that will fail at import/runtime with confusing errors.

  2. 72% fail

    Whack-a-mole; each new pin surfaces the next conflict and the final set is often still inconsistent.

  3. 85% fail

    Legacy resolver silently picks the first candidate, hiding the conflict and shipping a broken environment.