poetry "SolverProblemError" / no matching version in CI
poetry's solver evaluated your constraints and could not find a version of a package that satisfies all of them at once. It raises SolverProblemError and explains which requirement it could not meet.
What this error means
poetry install or lock fails with "SolverProblemError: Could not find a matching version of package X" or "Because ... depends on ... which doesn't match any versions".
SolverProblemError
Because myapp depends on django (>=5.0) which requires Python >=3.10
and the current project supports Python >=3.8, version solving failed.Common causes
A constraint excludes every published version
Your pyproject.toml constraint (or a Python version cap) leaves no release of the dependency that fits.
A Python version range too wide for a dependency
Supporting an old Python in tool.poetry.dependencies.python can make a modern package unsolvable across that range.
How to fix it
Align the constraint with available versions
- Read which dependency and which constraint poetry names.
- Loosen or correct the version range in
pyproject.toml. - Run
poetry lockto confirm the solver now succeeds.
poetry add "django@>=5.0"
poetry lockNarrow the supported Python range
If a dependency needs a newer Python, raise the project's minimum so the solver has a feasible set.
[tool.poetry.dependencies]
python = ">=3.10,<4.0"How to prevent it
- Keep the supported Python range as tight as your dependencies allow.
- Run
poetry locklocally before pushing so conflicts surface early. - Upgrade dependencies in groups to keep constraints consistent.