Poetry: pip-installing this codebase fails

Created on 21 Feb 2020  路  11Comments  路  Source: python-poetry/poetry

  • [x] I am on the latest Poetry version.
  • [x] I have searched the issues of this repo and believe that this is not a duplicate.
  • [x] 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: from master (96191ca)
  • Link of a Gist with the contents of your pyproject.toml file: N/A

Issue

The following command fails in a new Python 3.6.8 env, with the latest pip, setuptools, and wheel (pip==20.0.2, setuptools==45.2.0, wheel==0.34.2).

pip install git+https://github.com/python-poetry/poetry


Command output

Collecting git+https://github.com/python-poetry/poetry Cloning https://github.com/python-poetry/poetry to /tmp/pip-req-build-6cd8p6hc Running command git clone -q https://github.com/python-poetry/poetry /tmp/pip-req-build-6cd8p6hc Installing build dependencies ... done Getting requirements to build wheel ... error ERROR: Command errored out with exit status 1: command: /[...]/.pyenv/versions/3.6.8/envs/test/bin/python3.6 /[...]/.pyenv/versions/3.6.8/envs/test/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmp61iyu9vu cwd: /tmp/pip-req-build-6cd8p6hc Complete output (36 lines): Traceback (most recent call last): File "[...]/.pyenv/versions/3.6.8/envs/test/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 257, in <module> main() File "[...]/.pyenv/versions/3.6.8/envs/test/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 240, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "[...]/.pyenv/versions/3.6.8/envs/test/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 91, in get_requires_for_build_wheel return hook(config_settings) File "/tmp/pip-build-env-ns_zen05/overlay/lib/python3.6/site-packages/intreehooks.py", line 53, in get_requires_for_build_wheel return self._backend.get_requires_for_build_sdist(config_settings) File "/tmp/pip-build-env-ns_zen05/overlay/lib/python3.6/site-packages/intreehooks.py", line 38, in _backend obj = self._module_from_dir(modname) File "/tmp/pip-build-env-ns_zen05/overlay/lib/python3.6/site-packages/intreehooks.py", line 25, in _module_from_dir mod = importlib.import_module(modname) File "[...]/.pyenv/versions/3.6.8/lib/python3.6/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 994, in _gcd_import File "<frozen importlib._bootstrap>", line 971, in _find_and_load File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "<frozen importlib._bootstrap>", line 994, in _gcd_import File "<frozen importlib._bootstrap>", line 971, in _find_and_load File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 665, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 678, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/tmp/pip-req-build-6cd8p6hc/poetry/masonry/__init__.py", line 10, in <module> from .builder import Builder File "/tmp/pip-req-build-6cd8p6hc/poetry/masonry/builder.py", line 1, in <module> from .builders.complete import CompleteBuilder File "/tmp/pip-req-build-6cd8p6hc/poetry/masonry/builders/__init__.py", line 1, in <module> from .complete import CompleteBuilder File "/tmp/pip-req-build-6cd8p6hc/poetry/masonry/builders/complete.py", line 6, in <module> from poetry.factory import Factory File "/tmp/pip-req-build-6cd8p6hc/poetry/factory.py", line 10, in <module> from clikit.api.io.io import IO ModuleNotFoundError: No module named 'clikit' ---------------------------------------- ERROR: Command errored out with exit status 1: /[...]/.pyenv/versions/3.6.8/envs/test/bin/python3.6 /[...]/.pyenv/versions/3.6.8/envs/test/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmp61iyu9vu Check the logs for full command output.

Bug

All 11 comments

Also reproducible with:

pip install --no-binary :all: poetry

i'm having this same issue with poetry/clikit/python36, it's driving me nuts

Looks like poetry is using intreehooks to handle calling into poetry to install poetry.

From a glance it looks like the issue is that poetry's dependencies aren't being installed into the sandboxed environment. Not sure if that's an issue with intreehooks or poetry.

I'm guessing intreehooks doesn't promise to do any dependency installation, so ultimately the problem is with poetry. Looking at the flit's backend, they vendor their third party dependencies.

In fact, the PEP 517 documentation says (emphasis added):

Note in particular that the requirement for no requirement cycles means that backends wishing to self-host (i.e., building a wheel for a backend uses that backend for the build) need to make special provision to avoid causing cycles. Typically this will involve specifying themselves as an in-tree backend, and __avoiding external build dependencies__ (usually by vendoring them).

So the real issue is poetry uses poetry for it's build backend _and_ relies on external dependencies for that.

It looks like the external dependencies are pretty core to poetry's build API.

As a workaround, poetry could depend on intreehooks _and_ all of the dependencies itself requires for building in the build-system requires.

IMO - I don't see any reason why this ought to work for a python package installer

@jtratner poetry is a Python package which can be installed by using the standard Python package manager. Why should it's purpose make it's installation different from any other Python packages?

IMO - I don't see any reason why this ought to work for a python package installer

Poetry provides an installation method with Pip in the docs. As such, the wheel should be built somehow (so building with setup.py should at least work for this purpose), and IMO it should support installing from source as well (e.g., by using the option --no-binary :all: with pip install or from the codebase; instead of installing from the wheel which is the default).

I think this issue is a duplicate of #1975.

With 1.1.0 we will be seperating poetry the tool and poetry-core the PEP 517 build backend. This should resolve the issue in question. However, there is still an outstanding change in the pastel dependency used by poetry that needs to be resolved before this will work fully.

See: https://github.com/sdispater/pastel/pull/8

The original issue is not reproducible anymore. So I'm closing this one.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EdgyEdgemond picture EdgyEdgemond  路  3Comments

nikaro picture nikaro  路  3Comments

alexlatchford picture alexlatchford  路  3Comments

AWegnerGitHub picture AWegnerGitHub  路  3Comments

ulope picture ulope  路  3Comments