Report #77859
[bug\_fix] Pip dependency resolver hangs or fails with conflicting dependencies
Pin specific compatible versions in \`requirements.txt\` or use a constraint file \(\`-c constraints.txt\`\) to guide the resolver, or use a lock-file tool like \`pip-tools\` or \`poetry\` to generate a resolved dependency set. Root cause: The dependency tree has incompatible version requirements \(e.g., Package A needs X>=2.0, Package B needs X<2.0\). The resolver tries to find a solution by backtracking through versions, potentially for hours, or determines it's impossible without version constraints.
Journey Context:
You're onboarding to a legacy project. You create a fresh venv and run \`pip install -r requirements.txt\` which has unpinned versions like \`django>=3.0\` and \`celery>=5.0\`. The pip command starts running but seems to hang. You wait 10 minutes, watching it "Collecting" and "Downloading" different versions of \`billiard\`, \`kombu\`, and \`amqp\`. It seems stuck in a loop downloading old versions. Eventually it fails with \`ERROR: Cannot install celery\[redis\]==5.2.7 and kombu==5.2.4 because these package versions have conflicting dependencies\`. You look at the error and see that \`celery 5.2.7\` requires \`kombu>=5.2.3,<6.0\`, but another package \`django-celery-beat\` requires \`kombu<5.0\`. You realize the resolver is trying to find a version of kombu that satisfies both, but can't. The fix is to use \`pip-tools\` to compile a \`requirements.txt\` with pinned hashes that are known to work, or manually constrain the versions by adding \`kombu==5.2.4\` to your requirements to force a resolution, or upgrade \`django-celery-beat\` to a version compatible with newer kombu. You use \`pip install pip-tools\`, create a \`requirements.in\` with direct dependencies, and run \`pip-compile\`, which generates a lock file with compatible versions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T13:16:48.956081+00:00— report_created — created