Poetry 1.2 lockfiles can't always be installed by Poetry 1.1
See original GitHub issueFor version details etc, see repro below.
Issue
Poetry 1.2 can create lockfiles that aren’t installable by Poetry 1.1 due to different handling of . characters in dependency names.
If the configured repository uses the “simple” repository API, Poetry 1.2 replaces . characters with - characters in the name field of dependencies in the lockfile. Poetry 1.1 fails to install from this lockfile with a SolverProblemError.
I’m not sure what guarantees, if any, Poetry makes about lockfile compatibility between Poetry versions. This isn’t a “breaking” change, as such, but makes interoperability painful in cases where the Poetry version can’t be upgraded “atomically”. It might be that this just isn’t supported, in which case a “fix” might be a quick note in the changelog or something.
I’ve got a Docker-based repro using ruamel.yaml:
# syntax=docker/dockerfile:1.3-labs
FROM python:3.8 as poetry1.2
RUN pip install poetry==1.2.1
COPY <<"EOF" /src/pyproject.toml
[tool.poetry]
name = "dotdash"
version = "0.1.0"
description = ""
authors = [""]
[tool.poetry.dependencies]
python = "^3.8"
"ruamel.yaml" = "*"
[[tool.poetry.source]]
name = 'simple'
url = 'https://pypi.org/simple'
default = true
EOF
RUN cd /src && poetry lock
FROM python:3.8 as poetry1.1
RUN pip install poetry==1.1.15
COPY --from=poetry1.2 /src/ /src/
RUN cd /src && poetry install
which produces:
=> ERROR [poetry1.1 4/4] RUN cd /src && poetry install 1.9s
------
> [poetry1.1 4/4] RUN cd /src && poetry install:
#15 0.995 Creating virtualenv dotdash-VsnhxLU2-py3.8 in /root/.cache/pypoetry/virtualenvs
#15 1.569 Installing dependencies from lock file
#15 1.706
#15 1.706 SolverProblemError
#15 1.706
#15 1.706 Because dotdash depends on ruamel.yaml (*) which doesn't match any versions, version solving failed.
#15 1.706
#15 1.707 at /usr/local/lib/python3.8/site-packages/poetry/puzzle/solver.py:241 in _solve
#15 1.732 237│ packages = result.packages
#15 1.732 238│ except OverrideNeeded as e:
#15 1.732 239│ return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
#15 1.733 240│ except SolveFailure as e:
#15 1.733 → 241│ raise SolverProblemError(e)
#15 1.733 242│
#15 1.733 243│ results = dict(
#15 1.733 244│ depth_first_search(
#15 1.734 245│ PackageNode(self._package, packages), aggregate_package_nodes
Ignore the non-standard install method for Poetry - I’ve also tested with the recommended method, I’m just being lazy in the Dockerfile.
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:11 (7 by maintainers)

Top Related StackOverflow Question
@vito-c That sounds like a different issue entirely unrelated to the one here. You likely have a damaged cache from interrupting Poetry – try blowing away
$(poetry config cache-dir)/artifactsand runningpoetry cache clear --all .. In most cases, installing a lock file generated by Poetry 1.2 with Poetry 1.1 should work just fine; if you’re running in to problems I would suggest joining Discord or starting a discussion so that others can help you determine what the root cause might be.I was unable to get my 1.2.x lock file to run on our build server that uses 1.1.x Is there any documented workaround? I tried reverting my poetry version to 1.1.x, deleting/resetting my lock file but now everything hangs at
Resolving Dependencies...