Report #88082
[bug\_fix] pip.\_vendor.resolvelib.resolvers.ResolutionTooDeep: 2000000 or pip install hangs with 'Resolving dependencies...' indefinitely
Upgrade pip to the latest version, provide explicit version constraints to narrow the search space \(e.g., \`pip install packageA "requests<2.30"\`\), or use a constraints file \(\`-c constraints.txt\`\) to pin transitive dependencies.
Journey Context:
You execute \`pip install torch transformers\` in a fresh virtual environment. Pip begins backtracking through versions of \`numpy\`, \`filelock\`, and \`typing-extensions\`, consuming 100% CPU for over 20 minutes. Verbose output \(\`-v\`\) shows pip exploring historical versions of \`torch\` \(1.11.0, 1.10.0, etc.\) to satisfy a conflict where \`transformers\` requires \`numpy>=1.20\` and an older \`torch\` requires \`numpy<1.20\`. The resolver enters exponential backtracking because no single version of \`numpy\` satisfies both constraints across the explored versions. You realize the resolver needs human guidance. By upgrading pip to the latest version \(which contains heuristics to prefer recent versions and avoid deep backtracking\), and then explicitly constraining the installation to \`pip install torch transformers "numpy>=1.20,<1.24"\`, you eliminate the ambiguous search space. The resolver quickly finds a compatible solution using recent versions of both packages that agree on the numpy range, completing in seconds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T06:25:47.279612+00:00— report_created — created