pipenv "Locking Failed!" dependency resolution in CI
pipenv ran its resolver over your Pipfile and could not find versions that satisfy every requirement. It prints "Locking Failed!" with the offending dependency and constraint.
What this error means
pipenv lock or pipenv install fails with "Locking Failed!" and a resolver trace naming the package whose constraints could not be satisfied.
python
Locking Failed!
ResolutionImpossible:
[('urllib3<2', ...), ('urllib3>=2', ...)]Common causes
Incompatible constraints in the Pipfile
Two requirements demand non-overlapping ranges of a shared dependency, so pipenv cannot lock a single version.
A package unavailable for the target Python
A pinned package has no release for the Pipfile's python_version, so resolution fails.
How to fix it
Resolve the conflicting constraint
- Read which package pipenv could not lock.
- Loosen the over-tight constraint or upgrade the capping dependency in the Pipfile.
- Re-run
pipenv lockand commit the newPipfile.lock.
Terminal
pipenv lock --clearAlign python_version with available wheels
Set the Pipfile Python to a version your dependencies support so a lock is feasible.
Pipfile
[requires]
python_version = "3.12"How to prevent it
- Keep Pipfile constraints as ranges where possible.
- Run
pipenv lockbefore pushing so failures surface locally. - Match
python_versionto the wheels your dependencies publish.
Related guides
poetry "poetry.lock is not consistent with pyproject.toml" in CIFix poetry "pyproject.toml changed significantly since poetry.lock was last generated" in CI - the lockfile i…
poetry "SolverProblemError" / no matching version in CIFix poetry "SolverProblemError: Could not find a matching version of X" in CI - poetry's solver could not sat…
pip "ResolutionImpossible" dependency conflict in CIFix pip "ResolutionImpossible" in CI - the new resolver exhausted all candidates because two requirements dem…