Report #92428
[bug\_fix] Pip dependency resolver backtracking timeout
Use 'pip install --upgrade-strategy eager' to allow pip to upgrade dependencies to resolve conflicts, or constrain the dependency tree by specifying compatible versions in requirements.txt. For complex projects, migrate to 'pip-tools' \(pip-compile\) or 'poetry' to lock dependencies offline.
Journey Context:
Developer adds a new dependency 'django>=4.0' to a requirements file that already has 'requests==2.25.1' and 'urllib3==1.26.5'. Pip starts resolving and backtracks through many versions of indirect dependencies trying to find a compatible set. In CI, the job times out after 30 minutes. Developer tries 'pip install --no-deps' which works but misses dependencies. They examine the output with '-v' flag and see pip trying old versions of packages like 'charset-normalizer' and 'idna' from 2015. They realize the strict pin on 'requests==2.25.1' conflicts with 'django>=4.0' which requires newer 'asgiref', which requires newer 'typing-extensions', creating a constraint explosion. Removing the strict pin on requests or upgrading it to a compatible version allows the resolver to find a solution quickly. Using 'pip-compile' from pip-tools generates a locked requirements.txt with resolved versions, avoiding resolver runtime complexity.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T13:43:52.224600+00:00— report_created — created