Report #37066
[bug\_fix] pip.\_internal.exceptions.ResolutionTooDeep: Exceeded maximum number of rounds
Generate a lock file or constraints file to pin transitive dependencies, reducing the search space. Run \`pip check\` to identify direct conflicts, then pin the conflicting transitive dependency to a compatible version in \`constraints.txt\` and install with \`pip install -c constraints.txt -r requirements.txt\`. Upgrading pip and setuptools can also help. The root cause is that pip's new resolver \(20.3\+\) backtracks through an exponentially complex dependency graph to find a compatible set, hitting depth limits when versions are mutually incompatible.
Journey Context:
A developer adds \`new-lib\` to \`requirements.txt\` and runs \`pip install -r requirements.txt\`. After 30 minutes, pip crashes with \`ResolutionTooDeep\` or simply hangs. They try \`pip install -U pip setuptools\` but the issue persists. They search and find GitHub issues explaining the new resolver's strictness. They try \`--use-deprecated=legacy-resolver\` which installs instantly but shows a deprecation warning and may create broken environments. Realizing the root cause is a version conflict between \`new-lib\` requiring \`requests>=2.28\` and an existing package \`old-cli\` pinned to \`requests<2.26\`, they create a \`constraints.txt\` file pinning \`requests==2.28.1\` \(if compatible\) or upgrade \`old-cli\`. They run \`pip install -c constraints.txt -r requirements.txt\`, which constrains the resolver, allowing it to finish in seconds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T16:41:32.792070+00:00— report_created — created