LoginSignup
5
0

More than 3 years have passed since last update.

poetryでSolverProblemError

Posted at

1. 環境

(.venv) user$ python --version
Python 3.7.6
(.venv) user$ poetry -V
Poetry version 1.0.3

2. 現象

Cythonをインストールする時に以下のようなSolverProblemErrorが発生.

(.venv) user$ poetry install
Installing dependencies from lock file
Warning: The lock file is not up to date with the latest changes in pyproject.toml. You may be getting outdated dependencies. Run update to update them.

[SolverProblemError]
Because annotator depends on Cython (0.29.15) which doesn't match any versions, version solving failed.

Cythonは0.29.15で指定していた.

pyproject.toml
...
[tool.poetry.dependencies]
Cython = "0.29.15"
...

3. 解決策

poetry addならいける.

(.venv) user$ poetry add Cython
Using version ^0.29.15 for Cython

Updating dependencies
Resolving dependencies... (0.4s)


Package operations: 1 install, 0 updates, 0 removals

  - Installing cython (0.29.15)

poetry addだと自動的にバージョンを^で指定する.

pyproject.toml
...
[tool.poetry.dependencies]
Cython = "^0.29.15"
...

どうやらこれが必要だった模様.

Cython=0.29.15はpypiにもあるし,ドキュメント
によるとこの方法で指定すると>= 0.29.15 < 1.0.0になるはずなので0.29.15指定でも良さそうなものだが...

ちなみにaddじゃなくてもCython = "^0.29.15"で指定してinstallでもいける.

(.venv) user$ poetry install
Installing dependencies from lock file

Package operations: 1 install, 0 updates, 0 removals

  - Installing cython (0.29.15)
5
0
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
0