question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot "poetry add matplotlib", possible bug in dependency resolution

See original GitHub issue
  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: Ubuntu 18.04
  • Poetry version: 0.12.4
  • Contents of your pyproject.toml file: [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,❤️.0.1 || >3.0.1,<4.0 1: conflict: no versions of matplotlib match >3.0,❤️.0.1 || >3.0.1,<4.0 1: ! matplotlib (>3.0,❤️.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,❤️.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,❤️.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] [–] <name> (<name>)…

$ 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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sdispatercommented, Nov 11, 2018

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.

1reaction
sdispatercommented, Nov 1, 2018

If any version is supported and matplotlib requires a supported version why is this dependency not met?

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot "poetry add matplotlib", possible bug in dependency ...
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...
Read more >
How to solve Python poetry dependency error - Stack Overflow
Running the reverse command poetry config virtualenvs.create true solved the problem (maybe add --local to set it to individual projects).
Read more >
Basic usage | Documentation | Poetry - Python dependency ...
Specifying dependencies #. If you want to add dependencies to your project, you can specify them in the tool.poetry.dependencies section.
Read more >
Changelog - PDM
Fix a bug that unnamed requirements can't override the old ones in either add or update command. · Support mutual TLS to private...
Read more >
Managing Python Dependencies with Poetry
Dependency management and packaging tools for your Python project using poetry. How to install, configure and use it.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found