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.

Poetry ignores some transitive dependencies for the project

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).

Issue

It looks like Poetry ignores some transitive dependencies for the project. For example, it ignores bz2file as a dependency for the smart-open package:

$ pip check
smart-open 1.8.4 requires bz2file, which is not installed.

But dependency specified in setup.py. Full debug log is here: https://gist.github.com/ffix/77d153f8483dde2ded4dde3e35f64bfb

Another example is scikit-image:

$ pip check
scikit-image 0.13.1 requires matplotlib, which is not installed.
scikit-image 0.13.1 requires pywavelets, which is not installed.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
absassicommented, Jan 7, 2020

@hyacz I just reported the PyInstaller issue (pyinstaller/pyinstaller#4609), as the actual cause is conditional code to define requirements in their setup.py, instead of using PEP 508 markers.

I don’t think it is possible for Poetry to evaluate all possible branches in a setup.py that try to do “clever” things.

1reaction
hyaczcommented, Dec 3, 2019

Noticed the same issue with: pyinstaller 3.5 requires macholib, which is not installed.

OS: macOS 10.15.1 (19B88) Poetry version: 0.12.17

pyproject.toml

[tool.poetry]
name = "poetry-demo"
version = "0.1.0"
description = ""
authors = ["Haohao Zhang <hyacz@foxmail.com>"]

[tool.poetry.dependencies]
python = "^3.7"

[tool.poetry.dev-dependencies]
pyinstaller = "^3.5"

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
> poetry install
...

> poetry show --tree
pyinstaller 3.5 PyInstaller bundles a Python application and all its dependencies into a single package.
├── altgraph *
└── setuptools *

> poetry run pip check         
pyinstaller 3.5 requires macholib, which is not installed.

> poetry run pyinstaller --help               
Traceback (most recent call last):
  File "/Users/hyacz/Library/Caches/pypoetry/virtualenvs/poetry-demo-py3.7/bin/pyinstaller", line 10, in <module>
    sys.exit(run())
  File "/Users/hyacz/Library/Caches/pypoetry/virtualenvs/poetry-demo-py3.7/lib/python3.7/site-packages/PyInstaller/__main__.py", line 79, in run
    import PyInstaller.building.build_main
  File "/Users/hyacz/Library/Caches/pypoetry/virtualenvs/poetry-demo-py3.7/lib/python3.7/site-packages/PyInstaller/building/build_main.py", line 34, in <module>
    from ..depend import bindepend
  File "/Users/hyacz/Library/Caches/pypoetry/virtualenvs/poetry-demo-py3.7/lib/python3.7/site-packages/PyInstaller/depend/bindepend.py", line 28, in <module>
    from . import dylib, utils
  File "/Users/hyacz/Library/Caches/pypoetry/virtualenvs/poetry-demo-py3.7/lib/python3.7/site-packages/PyInstaller/depend/dylib.py", line 197, in <module>
    from macholib import util
ModuleNotFoundError: No module named 'macholib'
Read more comments on GitHub >

github_iconTop Results From Across the Web

Poetry ignores some transitive dependencies for the project
It looks like Poetry ignores some transitive dependencies for the project. For example, it ignores bz2file as a dependency for the smart-open ...
Read more >
Poetry ignore dependency in pyproject.toml - Stack Overflow
I currently have a Python3 project set up with ...
Read more >
Third-party dependencies - Pants build
Constraints files allow you to pin transitive dependencies to certain versions, overriding the version that pip/Pex would normally choose. Constraints files are ...
Read more >
Announcing Poetry 1.2.0 | Blog
Poetry 1.2 drops support for managing Python 2.7 projects, as: ... Any dependency declared in the legacy dev-dependencies section will ...
Read more >
poetry-lock-package - PyPI
Simple script that will take a pyproject.toml and a poetry.lock and generate a new poetry project where all the lock versions are pinned...
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