python install_error ai_generated true

package-a 1.0.0 requires package-b<2, but you have package-b 2.3.0 which is incompatible.

ID: python/pip-check-broken-requirements

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

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.x active — — —

Root Cause

An existing package installed outside pip's resolver (e.g., via conda, apt, or a previous --no-deps install) violates a declared dependency constraint.

generic

中文

已安装的包(通过 conda、apt 或之前的 --no-deps 安装)违反了声明的依赖约束。

Workarounds

  1. 92% success
    Create a fresh venv and reinstall: python -m venv .venv && . .venv/bin/activate && pip install -r requirements.txt
  2. 85% success
    Pin the correct version: pip install 'package-b<2'
  3. 80% success
    Audit with pip check and pipdeptree: pip install pipdeptree && pipdeptree --warn silence

Dead Ends

Common approaches that don't work:

  1. 70% fail

    Runtime imports may resolve to the wrong version and fail with AttributeError or ImportError.

  2. 60% fail

    Force-reinstall may pull in conflicting transitive deps and break other packages in the same env.

  3. 95% fail

    Removes the package you need instead of resolving the conflict.