Troubleshooting & FAQ
|
This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production. The reference material consulted while preparing these pages is listed in the Python Reference bibliography. |
Each entry below shows a problem as Poetry 2.5.1 reports it, why it happens and what fixes it. The errors were reproduced on
2026-10-22 on Linux with CPython 3.13.16 as the active interpreter (Poetry itself running on 3.14.6), in small scratch projects;
long outputs are shortened with …. pip’s equivalents are on
pip: Troubleshooting.
Resolution
"The current project’s supported Python range … is not compatible"
[project]
name = "tsdemo"
version = "0.1.0"
requires-python = ">=3.9"
dependencies = []
poetry add "numpy>=2.3"
The current project's supported Python range (>=3.9) is not compatible with some of the required packages Python requirement:
- numpy requires Python >=3.11, so it will not be installable for Python >=3.9,<3.11
- numpy requires Python >=3.12, so it will not be installable for Python >=3.9,<3.12
…
So, because numpy (2.5.4) requires Python >=3.12
and tsdemo depends on numpy (>=2.3), version solving failed.
* Check your dependencies Python requirement: The Python requirement can be specified via the `python` or `markers` properties
For numpy, a possible solution would be to set the `python` property to ">=3.11"
…
Why: unlike pip, which resolves for the one interpreter it runs on, Poetry locks for every Python in requires-python. Here
>=3.9 includes 3.9 and 3.10, for which no matching numpy exists. Fixes:
-
raise
requires-pythonto what the dependency supports (>=3.12here) if the project can drop the older Pythons; -
or restrict the dependency to some Pythons, with a marker (
numpy (>=2.3) ; python_version >= "3.12") or Poetry’spythonproperty; see Dependency Specification; -
or keep the published metadata open and give the solver a narrower range in
[tool.poetry.dependencies] python = ">=3.12", which Poetry uses only for locking.
The same problem appears with an upper bound: requires-python = ">=3.10,<4.0" (a translated ^3.10) cannot be satisfied by a
package that declares <3.14.
"version solving failed" between two requirements
poetry add "attrs<23" "cattrs>=25"
Because no versions of cattrs match >=25,!=25.1.0,!=25.1.1,!=25.2.0,!=25.3.0,!=26.1.0,!=26.2.0,!=26.2.1
and cattrs (25.1.0) depends on attrs (>=24.3.0), cattrs (>=25,!=25.1.1,!=25.2.0,!=25.3.0,!=26.1.0,!=26.2.0,!=26.2.1) requires attrs (>=24.3.0).
…
So, because tsdemo depends on both attrs (<23) and cattrs (>=25), version solving failed.
With -v, the traceback shows the exception behind the message: SolverProblemError, raised from the resolver’s
SolveFailureError (the strings come from src/poetry/mixology/failure.py). Read the last line first: it names the two
direct requirements that cannot both hold. The lines above it are the proof, release by
release. Fix one of the two constraints; poetry show --why and poetry show --tree --why <package> show who requires what in a working
project. Nothing is written: poetry add leaves pyproject.toml and poetry.lock unchanged when resolution fails (exit code 1).
Source: Poetry CLI: show, Poetry: Version constraints.
Resolution is slow
Poetry needs the metadata of many candidate releases for every platform. Where an index offers no PEP 658 metadata or the
JSON API has none, it downloads the files to read it, which costs time and bandwidth. The FAQ’s advice: constrain the package
Poetry is downloading many versions of more narrowly. Keep solver.lazy-wheel = true (the default), and keep the cache: the
second resolution is much faster. -vvv shows which package is being fetched.
poetry update <name> does nothing
poetry update stays inside the constraint in pyproject.toml. With attrs (>=25,<26) locked at 25.4.0 and 26.1.0 released:
Updating dependencies
Resolving dependencies...
No dependencies to install or update
poetry show --outdated lists attrs 25.4.0 26.1.0. Widen the constraint, or poetry add attrs@latest. (Since 2.4, a name that
is not a dependency at all is an error instead of being ignored.)
Should I put upper bounds on constraints?
poetry add writes ^1.2-style constraints, that is with an upper bound. The FAQ’s answer: for an application, an upper bound
protects against a future major release; for a library used by other packages, upper bounds cause needless conflicts for your
users, so prefer >= unless you know the next release breaks you. See
Versions & Dependency Specifiers.
Lock file
"pyproject.toml changed significantly since poetry.lock was last generated"
poetry install
Installing dependencies from lock file
pyproject.toml changed significantly since poetry.lock was last generated. Run `poetry lock` to fix the lock file.
Why: the content-hash in poetry.lock no longer matches the dependency-relevant parts of pyproject.toml (here a dependency was
added by hand). Since 1.8 this is an error, not a warning. Fix: poetry lock (it keeps every other locked version), review the
diff, commit both files together. In CI, fail early with poetry check --lock instead of locking there. After a merge conflict in
poetry.lock, resolve pyproject.toml first, take either side of the lock file and run poetry lock to rebuild it.
Source: Poetry CLI: lock, Poetry CLI: check.
The lock file is from another Poetry
A lock file written by a newer Poetry gives The lock file might not be compatible with the current version of Poetry. (newer
format, same major) or The lock file is not compatible with the current version of Poetry. (unknown major format). Upgrade
Poetry, or pin the team’s Poetry with requires-poetry; see
Versions & Release History.
Environments
"The currently activated Python version … is not supported by the project"
The currently activated Python version 3.13.16 is not supported by the project (>=3.15).
Trying to find and use a compatible version.
Poetry was unable to find a compatible version. If you have one, you can explicitly use it via the "env use" command.
Poetry starts from the python on PATH, then looks for another interpreter that satisfies requires-python. Install one (or
let Poetry do it with the experimental poetry python install 3.15) and select it with poetry env use 3.15. See
Managing Environments.
Poetry installs into the wrong environment
If a virtual environment is active (VIRTUAL_ENV is set, for example by tox, nox or your shell), Poetry uses it instead of its own.
poetry env info -p shows which one is in use. Deactivate the other environment, or use poetry run from a clean shell. With
virtualenvs.create = false, Poetry installs into whatever interpreter runs it; since 2.5.0 it at least fails with an error
when that interpreter does not satisfy the project.
virtualenvs.in-project seems to be ignored
The setting applies when an environment is created. A project that already has an environment in the cache keeps using it;
poetry env remove --all, then poetry install, creates .venv.
Commands that disappeared
poetry shell and poetry export are plugins since 2.0, and poetry run <cmd> reports Command not found: <cmd> when the
command is not installed in the environment. The replacements are on
Migrating to Poetry 2.
Network, credentials and caches
-
Authorization errors from a private source (
Source (birdwatch): Authorization error accessing …): setPOETRY_HTTP_BASIC_<NAME>_USERNAME/_PASSWORDorpoetry config http-basic.<name>, where<name>is the source’s name. A~/.netrccan conflict with configured credentials. See Repositories & Package Sources. -
A password starting with
-is read as an option (The option "s" does not exist): writepoetry config — http-basic.<name> <user> <password>. A password typed on the command line also ends up in shell history; prefer the prompt or environment variables. -
Keyring prompts or hangs in headless sessions (CI, containers, tox without
passenv): use the environment variables, orpoetry config keyring.enabled false, which stores credentials in plaintextauth.toml. -
TLS errors behind a proxy: Poetry does not use the system trust store; set
REQUESTS_CA_BUNDLEorcertificates.<name>.cert. -
Timeouts: the default HTTP timeout is 15 seconds, like pip’s; the experimental
POETRY_REQUESTS_TIMEOUTchanges it, andrequests.max-retries(2.0) retries on unstable networks. -
Stale or corrupt cache: rerun with
--no-cache(nothing is deleted); if that helps,poetry cache clear <source> --all.
Packaging surprises
-
Files missing from the wheel or sdist: poetry-core leaves out files that Git ignores, so a
.gitignorepattern can silently drop packaged files; check withunzip -l dist/*.whl.includeentries go to the sdist only unlessformatsays otherwise (since 2.0). -
Invalid versions: Poetry enforces PEP 440, so other tools can parse what it builds.
poetry version 1.0.0-hotfix.1answersInvalid PEP 440 version: '1.0.0-hotfix.1'(exit code 1); use a post-release,1.0.0.post1.
A debugging routine
-
poetry --versionandpoetry debug info: which Poetry, which Python runs it, which environment it uses and from which base interpreter. -
poetry check --strict: ispyproject.tomlvalid and the lock in step with it? -
poetry -vvv --no-cache <command>: every request, every resolver decision, no cached data:Disabling source caches Using virtualenv: …/ts/a/.venv name : attrs version : 26.1.0 description : Classes Without Boilerplate … -
poetry show --tree --why <package>: why a package is there (--whyalone with a package name is refused). -
poetry --no-plugins <command>: rule out a plugin. -
poetry debug resolve <package>andpoetry debug tags: what the resolver picks without touching the lock file, and which wheel tags the environment accepts. -
Search the issue tracker with the exact message, and follow the contributing guide’s checklist before filing a bug (latest release,
-vvvoutput, a minimalpyproject.toml).
More questions the Poetry FAQ answers
-
Is tox supported? Is nox? Yes; see tox, nox, pre-commit & Docker.
-
Poetry busts my Docker cache. Install with
--no-root --no-directorybefore copying the source; see CI Caching & Containers. -
Can I stop Poetry managing environments?
virtualenvs.create = false, but the FAQ strongly recommends a virtual environment, also in containers. -
How do I move from
[tool.poetry]to[project]? See Migrating to Poetry 2.