-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot "poetry add matplotlib", possible bug in dependency resolution #580
Comments
Ok, I manually edited pyproject.toml and it now works. Where I had: Now I have: Now I am not sure if I was supposed to hand edit that file, but I do not remember reading it in the docs. I have been using poetry for two months now and it was the first time I faced this difficulty. |
This is the expected behavior and the error says it all: matplotlib (3.0.0) requires Python >=3.5 while your project was compatible with any Python version ( |
Not so fast. The message does not explain the problem well, the message a user sees is: "[SolverProblemError] If any version is supported and matplotlib requires a supported version why is this dependency not met? Then I thought: well, if I am running python 3.6.6 and matplotlib requires >=3.5 why is poetry complaining and not just doing what I need it to do? It was only when filling this bug report I was asked to show the contents of pyproject.toml and saw the relevant line. If you designed the software in this way, so be it, but I would (A) improve the message and (B) improve the default setting. (A) (B) |
This is the other way around. Poetry will always try to find a package version that is compatible with the all the versions supported by the project. But I admit that the wording is not the clearest. I will see if I can improve it. |
Ok, but keep in mind that today a simple sequence of commands like the one bellow will cause error and will lead new users to the conclusion that poetry is broken right from the start. I would change this default behavior and avoid having people leave before they even taste poetry! mbello@mbello: Updating dependencies [SolverProblemError] add [-D|--dev] [--git GIT] [--path PATH] [-E|--extras EXTRAS] [--optional] [--python PYTHON] [--platform PLATFORM] [--allow-prereleases] [--dry-run] [--] ()... |
The default behavior will not change since I prefer people stumbling on the error when adding the package and make it clear for them what's going on than locking a version of a package that is not compatible with the Python versions supported by the project and lead to the confusion of not understanding why the package does not appear in non-supported Python versions. |
The error message has been improved in the latest |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
-vvv
option).[tool.poetry]
name = "test"
version = "0.1.0"
description = ""
authors = ["mbello mbello@users.noreply.github.com"]
[tool.poetry.dependencies]
python = "*"
[tool.poetry.dev-dependencies]
pytest = "^3.0"
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
Issue
Matplotlib requires python >=3.5
I am on python 3.6.6 and poetry does not allow me to install matplotlib.
The command poetry run pip install matplotlib did work as a workaround.
Steps to reproduce
$ rm -Rf test
$ poetry new test
Created package test in test
$ cd test
$ poetry --version
Poetry 0.12.4
$ python --version
Python 3.6.6
$ poetry run python --version
Creating virtualenv test-py3.6 in /home/mbello/PycharmProjects/test/.venv
Python 3.6.6
$ poetry -vvv add matplotlib
Using virtualenv: /home/mbello/PycharmProjects/test/.venv
PyPI: No release information found for matplotlib-0.63.0, skipping
PyPI: No release information found for matplotlib-0.64, skipping
PyPI: No release information found for matplotlib-0.65, skipping
PyPI: No release information found for matplotlib-0.70, skipping
PyPI: No release information found for matplotlib-0.71, skipping
PyPI: No release information found for matplotlib-0.83.2, skipping
PyPI: No release information found for matplotlib-0.85, skipping
PyPI: No release information found for matplotlib-0.87.1, skipping
PyPI: No release information found for matplotlib-0.87.2, skipping
PyPI: No release information found for matplotlib-0.87.3, skipping
PyPI: No release information found for matplotlib-0.87.4, skipping
PyPI: No release information found for matplotlib-0.87.5, skipping
PyPI: No release information found for matplotlib-0.87.6, skipping
PyPI: No release information found for matplotlib-0.87.7, skipping
PyPI: No release information found for matplotlib-0.90.0, skipping
PyPI: No release information found for matplotlib-0.90.1, skipping
PyPI: No release information found for matplotlib-0.91.2, skipping
PyPI: No release information found for matplotlib-0.91.3, skipping
PyPI: No release information found for matplotlib-0.91.4, skipping
PyPI: No release information found for matplotlib-0.98.0, skipping
PyPI: No release information found for matplotlib-0.98.1, skipping
PyPI: No release information found for matplotlib-0.98.3, skipping
PyPI: No release information found for matplotlib-0.98.5.1, skipping
PyPI: No release information found for matplotlib-0.98.5.3, skipping
PyPI: No release information found for matplotlib-0.99.0, skipping
PyPI: No release information found for matplotlib-0.99.1, skipping
PyPI: No release information found for matplotlib-0.99.3, skipping
PyPI: No release information found for matplotlib-1.0.0, skipping
PyPI: 41 packages found for matplotlib *
Using version ^3.0 for matplotlib
Updating dependencies
Resolving dependencies...
1: fact: test is 0.1.0
1: derived: test
1: fact: test depends on matplotlib (^3.0)
1: fact: test depends on pytest (^3.0)
1: selecting test (0.1.0)
1: derived: pytest (^3.0)
1: derived: matplotlib (^3.0)
PyPI: 42 packages found for pytest >=3.0,<4.0
PyPI: No release information found for matplotlib-0.63.0, skipping
PyPI: No release information found for matplotlib-0.64, skipping
PyPI: No release information found for matplotlib-0.65, skipping
PyPI: No release information found for matplotlib-0.70, skipping
PyPI: No release information found for matplotlib-0.71, skipping
PyPI: No release information found for matplotlib-0.83.2, skipping
PyPI: No release information found for matplotlib-0.85, skipping
PyPI: No release information found for matplotlib-0.87.1, skipping
PyPI: No release information found for matplotlib-0.87.2, skipping
PyPI: No release information found for matplotlib-0.87.3, skipping
PyPI: No release information found for matplotlib-0.87.4, skipping
PyPI: No release information found for matplotlib-0.87.5, skipping
PyPI: No release information found for matplotlib-0.87.6, skipping
PyPI: No release information found for matplotlib-0.87.7, skipping
PyPI: No release information found for matplotlib-0.90.0, skipping
PyPI: No release information found for matplotlib-0.90.1, skipping
PyPI: No release information found for matplotlib-0.91.2, skipping
PyPI: No release information found for matplotlib-0.91.3, skipping
PyPI: No release information found for matplotlib-0.91.4, skipping
PyPI: No release information found for matplotlib-0.98.0, skipping
PyPI: No release information found for matplotlib-0.98.1, skipping
PyPI: No release information found for matplotlib-0.98.3, skipping
PyPI: No release information found for matplotlib-0.98.5.1, skipping
PyPI: No release information found for matplotlib-0.98.5.3, skipping
PyPI: No release information found for matplotlib-0.99.0, skipping
PyPI: No release information found for matplotlib-0.99.1, skipping
PyPI: No release information found for matplotlib-0.99.3, skipping
PyPI: No release information found for matplotlib-1.0.0, skipping
PyPI: 2 packages found for matplotlib >=3.0,<4.0
1: fact: matplotlib (3.0.1) requires Python >=3.5
1: derived: not matplotlib (3.0.1)
1: fact: matplotlib (3.0.0) requires Python >=3.5
1: derived: not matplotlib (3.0.0)
1: fact: no versions of matplotlib match >3.0,<3.0.1 || >3.0.1,<4.0
1: conflict: no versions of matplotlib match >3.0,<3.0.1 || >3.0.1,<4.0
1: ! matplotlib (>3.0,<3.0.1 || >3.0.1,<4.0) is partially satisfied by not matplotlib (3.0.0)
1: ! which is caused by "matplotlib (3.0.0) requires Python >=3.5"
1: ! thus: matplotlib is forbidden
1: ! matplotlib (>=3.0,<3.0.1 || >3.0.1,<4.0) is partially satisfied by not matplotlib (3.0.1)
1: ! which is caused by "matplotlib (3.0.1) requires Python >=3.5"
1: ! thus: matplotlib is forbidden
1: ! matplotlib (>=3.0,<4.0) is satisfied by matplotlib (^3.0)
1: ! which is caused by "test depends on matplotlib (^3.0)"
1: ! thus: version solving failed
1: Version solving took 0.247 seconds.
1: Tried 1 solutions.
[SolverProblemError]
The current supported Python versions are *
Because no versions of matplotlib match >3.0,<3.0.1 || >3.0.1,<4.0
and matplotlib (3.0.0) requires Python >=3.5, matplotlib is forbidden.
So, because matplotlib (3.0.1) requires Python >=3.5
and test depends on matplotlib (^3.0), version solving failed.
Exception trace:
/home/mbello/.poetry/lib/poetry/vendor/py3.6/cleo/application.py in run() at line 94
status_code = self.do_run(input, output_)
/home/mbello/.poetry/lib/poetry/console/application.py in do_run() at line 88
return super(Application, self).do_run(i, o)
/home/mbello/.poetry/lib/poetry/vendor/py3.6/cleo/application.py in do_run() at line 197
status_code = command.run(input, output_)
/home/mbello/.poetry/lib/poetry/console/commands/command.py in run() at line 77
return super(BaseCommand, self).run(i, o)
/home/mbello/.poetry/lib/poetry/vendor/py3.6/cleo/commands/base_command.py in run() at line 146
status_code = self.execute(input, output_)
/home/mbello/.poetry/lib/poetry/_vendor/py3.6/cleo/commands/command.py in execute() at line 107
return self.handle()
/home/mbello/.poetry/lib/poetry/console/commands/add.py in handle() at line 139
status = installer.run()
/home/mbello/.poetry/lib/poetry/installation/installer.py in run() at line 76
self._do_install(local_repo)
/home/mbello/.poetry/lib/poetry/installation/installer.py in _do_install() at line 158
ops = solver.solve(use_latest=self._whitelist)
/home/mbello/.poetry/lib/poetry/puzzle/solver.py in solve() at line 37
packages, depths = self._solve(use_latest=use_latest)
/home/mbello/.poetry/lib/poetry/puzzle/solver.py in _solve() at line 154
raise SolverProblemError(e)
add [-D|--dev] [--git GIT] [--path PATH] [-E|--extras EXTRAS] [--optional] [--python PYTHON] [--platform PLATFORM] [--allow-prereleases] [--dry-run] [--] ()...
$ poetry run pip install matplotlib
Collecting matplotlib
Using cached https://files.pythonhosted.org/packages/1e/f8/4aba1144dad8c67db060049d1a8bc740ad9fa35288d21b82bb85de69ff15/matplotlib-3.0.1-cp36-cp36m-manylinux1_x86_64.whl
Collecting python-dateutil>=2.1 (from matplotlib)
Using cached https://files.pythonhosted.org/packages/74/68/d87d9b36af36f44254a8d512cbfc48369103a3b9e474be9bdfe536abfc45/python_dateutil-2.7.5-py2.py3-none-any.whl
Collecting cycler>=0.10 (from matplotlib)
Using cached https://files.pythonhosted.org/packages/f7/d2/e07d3ebb2bd7af696440ce7e754c59dd546ffe1bbe732c8ab68b9c834e61/cycler-0.10.0-py2.py3-none-any.whl
Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 (from matplotlib)
Using cached https://files.pythonhosted.org/packages/2b/4a/f06b45ab9690d4c37641ec776f7ad691974f4cf6943a73267475b05cbfca/pyparsing-2.2.2-py2.py3-none-any.whl
Collecting kiwisolver>=1.0.1 (from matplotlib)
Using cached https://files.pythonhosted.org/packages/69/a7/88719d132b18300b4369fbffa741841cfd36d1e637e1990f27929945b538/kiwisolver-1.0.1-cp36-cp36m-manylinux1_x86_64.whl
Collecting numpy>=1.10.0 (from matplotlib)
Using cached https://files.pythonhosted.org/packages/16/21/2e88568c134cc3c8d22af290865e2abbd86efa58a1358ffcb19b6c74f9a3/numpy-1.15.3-cp36-cp36m-manylinux1_x86_64.whl
Collecting six>=1.5 (from python-dateutil>=2.1->matplotlib)
Using cached https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Requirement already satisfied: setuptools in ./.venv/lib/python3.6/site-packages (from kiwisolver>=1.0.1->matplotlib)
Installing collected packages: six, python-dateutil, cycler, pyparsing, kiwisolver, numpy, matplotlib
Successfully installed cycler-0.10.0 kiwisolver-1.0.1 matplotlib-3.0.1 numpy-1.15.3 pyparsing-2.2.2 python-dateutil-2.7.5 six-1.11.0
The text was updated successfully, but these errors were encountered: