Report #75669
[bug\_fix] Pip dependency resolver hangs or ResolutionImpossible
Pin transitive dependencies using a constraints file \(\`-c constraints.txt\`\) or migrate to a lockfile tool \(pip-tools/poetry\). Root cause: The pip resolver \(>=20.3\) requires strict dependency satisfaction. Conflicting version pins in the dependency tree \(e.g., \`requests>=2.25\` requires \`urllib3<1.27\` but \`botocore\` requires \`urllib3>=1.26.4,<1.27\`\) cause exponential backtracking or impossible resolution if no compatible version exists.
Journey Context:
You add \`boto3==1.20.0\` to \`requirements.txt\` which already has \`requests==2.26.0\`. You run \`pip install -r requirements.txt\`. Pip starts collecting, then spins for 15 minutes with \`INFO: pip is looking at multiple versions of urllib3 to determine which version is compatible\`. It eventually fails with \`ResolutionImpossible\`, citing that \`botocore\` requires \`urllib3<1.27,>=1.26.4\` while \`requests\` requires \`urllib3<1.27,>=1.26.0\`. You realize that while both constraints technically overlap \(\`1.26.4\` to \`1.27\`\), the resolver is failing due to other hidden constraints or because you have an old \`pip\` cache. You manually pin \`urllib3==1.26.5\` in a \`constraints.txt\` file and run \`pip install -r requirements.txt -c constraints.txt\`, which forces a compatible version and bypasses the backtracking. The long-term fix is adopting \`pip-compile\` \(pip-tools\) to generate a \`requirements.lock\` with resolved transitive pins, ensuring reproducible installs without resolver search at deploy time.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T09:36:35.252254+00:00— report_created — created