1.0.10 -> 1.1 regression: EnvCommandError: 'No module named setuptools' on Python 3.7
See original GitHub issueThis 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'
Issue Analytics
- State:
- Created 3 years ago
- Reactions:18
- Comments:41 (18 by maintainers)
Top Results From Across the Web
Python 3: ImportError "No Module named Setuptools"
I'm having troubles with installing packages in Python 3. I have always installed packages with setup.
Read more >ModuleNotFoundError: No module named 'setuptools' in Python
The Python "ModuleNotFoundError: No module named 'setuptools'" occurs when setuptools is not installed in our Python environment.
Read more >EnvCommandError - cannot get django tutorial to deploy
I created an environment variable to get render to use python 3.8.2 ... Oct 16 08:24:48 PM ModuleNotFoundError: No module named 'setuptools'
Read more >Python 3.7.0 No Module Named 'Pyqt5.Qtwebenginewidgets'
Poetry: 1.0.10 1.1 regression: EnvCommandError: 'No module named setuptools' on Python 3.7. Created on 9 Oct 2020 19Comments Source: pythonpoetry/.
Read more >Bountysource
1.0.10 -> 1.1 regression: EnvCommandError: 'No module named setuptools' on Python 3.7.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
In https://github.com/python-poetry/poetry/issues/1135#issuecomment-719902456 @NeilGirdhar pointed out that one would need to change pyproject.toml to include setuptools:
With this added in my above example (reproduce-3153.zip) it now builds:
And indeed, as others have mentioned in https://github.com/python-poetry/poetry/issues/34, this is not a
poetry
issue. But it seems like many would likepoetry
to have a workaround.same issue, wrapt depends on it, manually removing setuptools from the poetry.lock worked for me