Report #6904
[bug\_fix] pip hangs on 'Resolving dependencies...' then fails with ResolutionImpossible or takes excessive time
Add explicit constraints for the conflicting transitive dependency in requirements.txt to shortcut the resolver, or use a lock-file tool \(pip-tools, Poetry\) to resolve dependencies statically. Pin direct dependencies to compatible versions to reduce the search space.
Journey Context:
Developer adds 'apache-airflow>=2.0' to requirements.txt which already contains 'flask>=2.0'. Running 'pip install -r requirements.txt' causes pip to enter deep backtracking. It tries airflow 2.0 which requires flask<2.0, conflicts with flask>=2.0, so it tries airflow 2.1, same issue. It continues downgrading airflow versions trying to find one compatible with flask>=2.0, potentially checking dozens of versions and their transitive dependencies \(pandas, numpy, etc.\), taking 30\+ minutes. Eventually pip gives up with ResolutionImpossible, listing the conflicting requirements. The developer tries 'pip install apache-airflow' in a fresh venv and it works, realizing the conflict is with the existing pinned flask version. They search for airflow's dependency constraints and find it strictly requires flask<2.0. Instead of letting pip backtrack through every airflow version, they manually pin 'flask>=1.0,<2.0' and 'apache-airflow>=2.0' explicitly, or they remove the flask pin entirely to let airflow dictate the version. Using pip-tools to compile a lock file would have caught this conflict statically without the long backtracking.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T01:18:06.021495+00:00— report_created — created