Report #102918
[bug\_fix] pip dependency resolver backtracks endlessly or reports \`Cannot install and because these package versions have conflicting dependencies\`
Pin a coherent set of direct and transitive dependencies \(e.g., generate a lockfile with \`pip-compile\` or \`uv pip compile\`\) and upgrade pip. If the conflict is immediate, add tight constraints \(\`pkg==x.y\`\) to the direct requirements and let pip surface the true conflict, then relax or pin the offending transitive dependency explicitly. The root cause is an NP-hard SAT problem: two packages require incompatible ranges of a shared transitive dependency, and pip's resolver explores the version graph until it proves unsatisfiability.
Journey Context:
You add \`flask==2.0\` and \`werkzeug==3.0\` to requirements. \`pip install -r requirements.txt\` spins for minutes, installing and uninstalling old versions. Eventually it errors with 'these package versions have conflicting dependencies'. You inspect the metadata and see Flask 2.0 requires Werkzeug >=2.0,<3.0. You either downgrade Werkzeug or upgrade Flask. You switch to \`pip-tools\` to lock a consistent set so CI never revisits the search.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-10T04:42:36.157749+00:00— report_created — created