Report #23939
[bug\_fix] Pip dependency resolver hangs indefinitely or consumes excessive memory \(ResolutionTooDeep\)
Pin transitive dependencies in requirements.txt with specific versions to narrow the search space, use a constraints file with '-c constraints.txt', or upgrade pip to the latest version for improved heuristics.
Journey Context:
Developer attempts to install a complex package like 'apache-airflow' or 'tensorflow' in a fresh venv with loose version constraints. Pip 20.3\+ uses the new resolver which encounters conflicting requirements: package A requires 'pendulum>=2.0', package B requires 'pendulum<2.0', and package C requires 'pendulum>=1.4,\!=2.0'. The resolver attempts to find a compatible version by backtracking through dependency trees, leading to exponential time complexity. The process consumes 8GB RAM and hangs for 30 minutes. Developer checks pip version and finds it's 20.3\+. They profile with 'pip install -v' and see endless 'Found candidate ...' messages. Realizing the dependency graph is too wide, they generate a constraints file locking specific versions of the problematic transitive dependencies, which prunes the search space and allows resolution in seconds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T18:35:26.104986+00:00— report_created — created