Repository navigation
Closed
Description
This may because it's installing a nested package. Python 3.8 doesn't have this issue but 3.7 does. I don't have a reduced test case yet. I'm hoping the traceback is helpful and someone knows what's going on from it. Python 3.7 and 3.8 are fine with Poetry 1.0.10, everything else being identical. Python 3.8 with Poetry 1.1.2 is fine as well, just not Python 3.7 with Poetry 1.1.2.
EnvCommandError
Command ['/usr/local/bin/python', '-m', 'pip', 'install', '--no-deps', '-U', '/builds/[redacted]'] errored with the following return code 2, and output:
Looking in indexes: https://[redacted]
Processing ./packages/[redacted]
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
ERROR: Exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 216, in _main
status = self.run(options, args)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/cli/req_command.py", line 182, in wrapper
return func(self, options, args)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 325, in run
reqs, check_supported_wheels=not options.target_dir
File "/usr/local/lib/python3.7/site-packages/pip/_internal/resolution/legacy/resolver.py", line 183, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File "/usr/local/lib/python3.7/site-packages/pip/_internal/resolution/legacy/resolver.py", line 388, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/resolution/legacy/resolver.py", line 340, in _get_abstract_dist_for
abstract_dist = self.preparer.prepare_linked_requirement(req)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/operations/prepare.py", line 483, in prepare_linked_requirement
req, self.req_tracker, self.finder, self.build_isolation,
File "/usr/local/lib/python3.7/site-packages/pip/_internal/operations/prepare.py", line 91, in _get_prepared_distribution
abstract_dist.prepare_distribution_metadata(finder, build_isolation)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/distributions/sdist.py", line 38, in prepare_distribution_metadata
self._setup_isolation(finder)
File "/usr/local/lib/python3.7/site-packages/pip/_internal/distributions/sdist.py", line 96, in _setup_isolation
reqs = backend.get_requires_for_build_wheel()
File "/usr/local/lib/python3.7/site-packages/pip/_vendor/pep517/wrappers.py", line 161, in get_requires_for_build_wheel
'config_settings': config_settings
File "/usr/local/lib/python3.7/site-packages/pip/_vendor/pep517/wrappers.py", line 265, in _call_hook
raise BackendUnavailable(data.get('traceback', ''))
pip._vendor.pep517.wrappers.BackendUnavailable: Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 86, in _build_backend
obj = import_module(mod_path)
File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/tmp/pip-build-env-l4t_85ci/overlay/lib/python3.7/site-packages/poetry/masonry/api.py", line 1, in <module>
from poetry.core.masonry.api import build_sdist
File "/tmp/pip-build-env-l4t_85ci/overlay/lib/python3.7/site-packages/poetry/core/masonry/__init__.py", line 10, in <module>
from .builder import Builder
File "/tmp/pip-build-env-l4t_85ci/overlay/lib/python3.7/site-packages/poetry/core/masonry/builder.py", line 6, in <module>
from .builders.sdist import SdistBuilder
File "/tmp/pip-build-env-l4t_85ci/overlay/lib/python3.7/site-packages/poetry/core/masonry/builders/__init__.py", line 2, in <module>
from .wheel import WheelBuilder
File "/tmp/pip-build-env-l4t_85ci/overlay/lib/python3.7/site-packages/poetry/core/masonry/builders/wheel.py", line 18, in <module>
from packaging.tags import sys_tags
File "/tmp/pip-build-env-l4t_85ci/overlay/lib/python3.7/site-packages/poetry/core/_vendor/packaging/tags.py", line 7, in <module>
import distutils.util
File "/usr/local/lib/python3.7/site-packages/_distutils_hack/__init__.py", line 83, in create_module
return importlib.import_module('._distutils', 'setuptools')
File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named 'setuptools'
Reacted by Christian Lent, Jonathan Piché, Kristoffer Bakkejord, Ari, buck54321, Frankie Robertson, Ilya Baryshnikov, boreBoar, Jonathan Wren, hiroshi.matsui and 8 more
Metadata
Metadata
Assignees
Labels
No labels
Activity
abn commentedon Oct 9, 2020
@gitpushdashf looks like this is an issue with the version of
pipinstalled with your3.7installation. Looks like you are installing without a virtual environment. If this is the case, first try after perorming/usr/local/bin/python -m pip install -U pip.Another possibility is, if you are using an Ubuntu distro, the distutils version installed might be interfering with your install.
gitpushdashf commentedon Oct 9, 2020
Thanks for replying!
This is using the python:3.7 and python3.8 Docker images which I believe are Debian based. With that image should I be doing
python3 -m pip installor ispip3 installokay?abn commentedon Oct 9, 2020
@gitpushdashf fwiw; I cannot reproduce this in a container, any chance you can provide some steps to reproduce this? Typically the containers should have
pythonpointing to the tag version andpippointing to the correspondingpipversion. The use ofpython3.7 -m pipis more done for safety and portability.abn commentedon Oct 9, 2020
Also this indicates you are using the old
build-systemconfiguration in your dependency project.I would recommend you try moving to the standalone build backend.
jonapich commentedon Oct 16, 2020
I am also getting this error and I can reproduce it.
https://github.com/jonapich/test-poetry-setuptools
Clone that repo, and try "poetry install" in the test-functools folder, you will get the same stacktrace as in the bug report.
This seems pretty serious 🤔
I'm on 1.1.3, Windows, using powershell. I installed using the get-poetry bootstrap.
I have confirmed that this bug appears when going from 1.0.10 -> 1.1 and it was also working in 1.0.9
Also, I never used python 3.7; only 3.6 and 3.8.
guhcampos commentedon Oct 19, 2020
I can confirm this is a problem and affects anything that ultimately still depends on calling
python setup.py, such as:pip install -epyproject.tomllike @jonapich demonstrates withtest-testing = { path = "../test-testing/" }I can confirm the problem with Python 3.6, 3.7 and 3.8 alike.
And this is really hard to debug because even if you literally copy and paste the command it's trying to run, it just works, in my case for a sample package:
But if I simply copy and paste the command below, it runs ok:
To make this "work" I had to install bogus
setup.pyfiles to my packages, such as:Yet it still fails when running from within poetry.
abn commentedon Oct 19, 2020
@jonapich based on your description I have attempted to recreate the scenario (minus the windows environment). Let me know what needs to be changed to reproduce the issue.
Console Output
jonapich commentedon Oct 21, 2020
I was able to make it work on a clean windows 2019 server as well... 🤔 But you need py3.8 or below, because there's no wheels for typed_ast in 3.9 and you'll need to install the vs c++ build tools.
I'll have to investigate what's different on my system.
jonapich commentedon Oct 21, 2020
So far, I can still reproduce the issue when going through poetry, but not when going through pip. My issue matches the OP's behavior:
Console Output
jonapich commentedon Oct 21, 2020
I went through the trouble of removing everything python and poetry off my system. I then reinstalled py3.8 using the latest installer and then reinstalled poetry using the Invoke-Webrequest method from the docs.
The behavior is still the same. Some observations:
poetry run python -m pip listI can see setuptools is installed in the project's virtual environment.poetry run pythonI canimport distutils.utilThis is where poetry breaks it for me even though python/pip can handle it:
poetry shelland then proceed topip install ../test-testing/it will fail.python -m venv virtualenvand then callvirtualenv/Scripts/pip install ../test-testing/it works.Additional note: The dependencies in
test-testinghave no effect on the issue. I tried to remove them all but I'm still unable to install it ifpoetryis involved with it.jonapich commentedon Oct 23, 2020
I wasn't able to find the cause of the problem. After a fresh install of Windows 10, I am no longer experiencing the issue and I can install the test repo that I created for this issue.
gitpushdashf commentedon Nov 4, 2020
Did something change between 1.1.3 and 1.1.4 that may have fixed this?
Python 3.7 Docker container:
jonapich commentedon Nov 4, 2020
The repo reproduced the issue on my system only. Then I had to reformat for a non related reason, and I could not reproduce the issue anymore.
Sorry I cannot be of any more help. This issue is resolved as far as I'm concerned. Is your original issue still happening? Did you try to repo in a container or VM?
33 remaining items
generalpiston commentedon Nov 18, 2021
@abn see below.
poetry 1.1.11.
Reproduction
Dockerfile:
pyproject.toml:
abn commentedon Nov 19, 2021
@generalpiston looks like I can only reproduce it if the lock file was generated with a
1.2.0aversion and then attempted to be instaleld using1.1.11.I believe the issue here is that since
1.2.zwill no longer treatsetuptoolsas an ignored dependency (#2826), they end up in the lock file. So, if the lock file was generated by such a version, the the older version (here1.1.11), will behave unexpectedly.Try either regenerating the lock file using
1.1.11or using a preview release in your container.generalpiston commentedon Nov 19, 2021
@abn good point. Apparently I have
1.2.0ainstalled for some reason. Thanks for pointing that out! Downgrading to 1.1.11 fixes the problem.abn commentedon Nov 19, 2021
I'm going to close this issue as poetry no longer depends on using the venv provided setuptools not pip.
And the only case this seems to be triggered is when lock file was generated with a pre-release version and installed using an older release.
Fixing install error on JupyterLab
feat: add changelog / release notes support
feat: add changelog / release notes support
akashkj commentedon Feb 5, 2022
It worked for me by upgrading setuptools and pip to the latest versions
fosskers commentedon Feb 21, 2022
This still happens on a fresh install of Poetry (1.1.13) with Python 3.10.2 (on Arch Linux, at least). I tried to follow the
poetry-demotutorial but it exploded when I attempted:Adding
setuptoolsto the[build-system]section doesn't fix it. Note that I'm using the system-provided versions ofpip(20.3.4) andsetuptools(59.3.0), although the virtualenv seems to be pulling it's own version ofpipanyway (21.3.1).Update: Actually the problem may be with
pendulumitself. I was just able to do apoetry add more-itertoolswithout issue.feat: add changelog / release notes support
github-actions commentedon Mar 2, 2024
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.