Bug or messaging problem?
See original GitHub issue- I have searched the issues of this repo and believe that this is not a duplicate.
- I have searched the documentation and believe that my question is not covered.
Issue
I’m not sure if this is a bug or a problem with the messaging in Poetry, but it’s something I see a lot, and it’s rather hard to search for in the issues so sorry if it’s a dupe. Here’s the problem…
I have a pyproject.toml that includes this in dev dev dependencies…
[tool.poetry.dev-dependencies]
faker = "*"
mixer = "*"
I discover that mixer
is pretty much abandoned and has a bug that breaks my tests, but all my tests depend on it, so I fork the repo and try to switch to installing from my fork by editing the pyproject.toml
[tool.poetry.dev-dependencies]
faker = "*"
mixer = {path = "src/mixer/"}
I then run poetry install
and I get this output…
[SolverProblemError]
Because no versions of mixer match !=6.1.3
and mixer (6.1.3) depends on Faker (0.9.1), every version of mixer requires Faker (0.9.1).
So, because no versions of faker match 0.9.1
and myproject depends on mixer (*), version solving failed.
This is telling me that there is no version 0.9.1 of faker. So, I check the faker release history and there it is, 0.9.1
Then I remember how often Poetry does this to me, and instead of editing the pyproject.toml
I run poetry add faker="0.9.1"
and get this output…
Updating dependencies
Resolving dependencies... (4.7s)
Writing lock file
Package operations: 0 installs, 3 updates, 1 removal
- Updating text-unidecode (1.3 -> 1.2)
- Updating faker (4.0.3 -> 0.9.1)
- Updating mixer (5.5.7 -> 6.1.3 src/mixer)
- Removing fake-factory (0.5.7)
So, if Faker 0.9.1 definitely exists, and poetry is perfectly able to resolve the dependencies, why does it tell me that it can’t in the first message?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:10
- Comments:7 (2 by maintainers)
In some comments I read that the issue occurs when running
poetry install
after manually editingpyproject.toml
. At least in some cases, the issue may be that poetry tries to install dependencies frompoetry.lock
(if existing). However, after manually editingpyproject.toml
it may be insconsistent withpoetry.lock
. In this case,poetry lock [--no-update]
should be called before runningpoetry install
. In contrast, when runningpoetry add
, the lock file is updated automatically. Alternatively,poetry update
can be used to lock and install in one step.We see similar errors thrown intermittently during CI/CD, but right now one of our developers is consistently unable to run
poetry install
because it fails with the messageBecause my-package depends on pydantic (^1.8.2) which doesn't match any versions, version solving failed.
This package version does exist and can be resolved on other machines. We cannot provide a minimum reproducible example because we don’t know what causes it.