[PYTHON] Solver Problem Error in poetry

1. Environment

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

2. Phenomenon

The following SolverProblemError occurs when installing Cython.

(.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 was specified by 0.29.15.

pyproject.toml


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

3. Solution

You can do it with 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)

With poetry add, the version is automatically specified with^.

pyproject.toml


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

Apparently this was necessary.

Cython = 0.29.15 is also on the pypi and documents According to this method, > = 0.29.15 <1.0.0 should be specified, so it seems that it is okay to specify 0.29.15. .. ..

By the way, you can specify Cython =" ^ 0.29.15 " and ʻinstall instead of ʻadd.

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

Package operations: 1 install, 0 updates, 0 removals

  - Installing cython (0.29.15)

Recommended Posts

Solver Problem Error in poetry
Implement extension field in Python
Solver Problem Error in poetry
Error in random.shuffle
Error in Pyinstaller
Error in TensorBoard
Error handling in PythonBox
zipimporter error in pyramid
How to install poetry (error handling) in zsh environment
Multiprocessing error in Jupyter Notebook
Sudoku solver implemented in Python 3
Slice error in python (´ ; ω ; `)
[Note] Project Euler in Python (Problem 1-22)
ABC166 in Python A ~ C problem
Small change minimization problem in wallet
[Error handling] peewee.IntegrityError 1451 occurs in peewee
An error occurred in scikit-learn imputer
Fix setuptools missing error in anaconda
ModuleNotFoundError in poetry: No module named'setuptools'