uv: ModuleNotFoundError: No module named 'setuptools.command.test'
Overview
I got the similar error ModuleNotFoundError: No module named 'setuptools.command.test' with the install command on GitHub Actions as the benchmarks workflow was failed.
error: Failed to prepare distributions
Caused by: Failed to fetch wheel: logbook==1.5.3
Caused by: Failed to build: `logbook==1.5.3`
Caused by: Build backend failed to determine extra requires with `build_wheel()` with exit status: 1
--- stdout:
--- stderr:
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/runner/.cache/uv/builds-v0/.tmp6kYDCi/lib/python3.11/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/.cache/uv/builds-v0/.tmp6kYDCi/lib/python3.11/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
self.run_setup()
File "/home/runner/.cache/uv/builds-v0/.tmp6kYDCi/lib/python3.11/site-packages/setuptools/build_meta.py", line 497, in run_setup
super().run_setup(setup_script=setup_script)
File "/home/runner/.cache/uv/builds-v0/.tmp6kYDCi/lib/python3.11/site-packages/setuptools/build_meta.py", line 313, in run_setup
exec(code, locals())
File "<string>", line 64, in <module>
ModuleNotFoundError: No module named 'setuptools.command.test'
The failed benchmarks workflow
https://github.com/astral-sh/uv/actions/runs/10137169832/job/28027028298
error: Failed to download and build `pyhive==0.7.0`
Caused by: Failed to build: `pyhive==0.7.0`
Caused by: Build backend failed to determine extra requires with `build_wheel()` with exit status: 1
--- stdout:
--- stderr:
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/runner/work/uv/uv/.cache/builds-v0/.tmpuS9Fnv/lib/python3.10/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[])
File "/home/runner/work/uv/uv/.cache/builds-v0/.tmpuS9Fnv/lib/python3.10/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
self.run_setup()
File "/home/runner/work/uv/uv/.cache/builds-v0/.tmpuS9Fnv/lib/python3.10/site-packages/setuptools/build_meta.py", line 497, in run_setup
super().run_setup(setup_script=setup_script)
File "/home/runner/work/uv/uv/.cache/builds-v0/.tmpuS9Fnv/lib/python3.10/site-packages/setuptools/build_meta.py", line 313, in run_setup
exec(code, locals())
File "<string>", line 4, in <module>
ModuleNotFoundError: No module named 'setuptools.command.test'
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 10
- Comments: 28 (11 by maintainers)
Commits related to this issue
- fix: add workaround for django-celery-beat/setuptools breakage Improved version which restricts just setuptools without blocking other upgrades. This had to be done by disabling build isolation, see ... — committed to WeblateOrg/docker by nijel 2 years ago
- Pin setuptools and use it See: https://github.com/astral-sh/uv/issues/5551 https://github.com/pypa/setuptools/issues/4519 — committed to fauust/buildbot by fauust 2 years ago
- Pin setuptools and use it See: https://github.com/astral-sh/uv/issues/5551 https://github.com/pypa/setuptools/issues/4519 — committed to fauust/buildbot by fauust 2 years ago
- Pin setuptools and use it See: https://github.com/astral-sh/uv/issues/5551 https://github.com/pypa/setuptools/issues/4519 — committed to fauust/buildbot by fauust 2 years ago
- Pin setuptools and use it See: https://github.com/astral-sh/uv/issues/5551 https://github.com/pypa/setuptools/issues/4519 — committed to MariaDB/buildbot by fauust 2 years ago
- build: Update _shared-build-deploy-docs.yml Force --no-build-isolation as suggested in https://github.com/astral-sh/uv/issues/5551 — committed to eurotech/add-ons-automation by MMaiero 2 years ago
- build: Update _shared-build-deploy-docs.yml (#28) Force --no-build-isolation as suggested in https://github.com/astral-sh/uv/issues/5551 — committed to eurotech/add-ons-automation by MMaiero 2 years ago
For the future, you can also set
UV_EXCLUDE_NEWER=2024-07-27or similar to avoid pulling in new versions, at least temporarily.setuptools 72.0.0 is yanked
https://github.com/pypa/setuptools/issues/4519#issuecomment-2255940870
It is extremely important to be able to constrain build environments. Whether it’s the same variable or not, but it’s important to be able to do it! It’s used all the time with PIP_CONSTRAINTS.
This isn’t uv’s fault. See https://github.com/pypa/setuptools/issues/4519#issuecomment-2254983472 , but use
UV_CONSTRAINTenv var insteadEdit: oops,
UV_CONSTRAINTdoesn’t actually work the same way, see https://github.com/astral-sh/uv/issues/5551#issuecomment-2255039974Will track here: https://github.com/astral-sh/uv/issues/5561
Thanks. Still wondering if we should apply constraints to build environments 😃
As setuptools 72.0.0 has been yanked, I suppose we no longer need the workaround at the moment. I will close the issue in a few days for the visibility just in case, because some users might be still confused by the deprecation issue. Thank you all for your help.
https://pypi.org/project/setuptools/#history
Hi,
I’m not able to find a workaround for this as I’m using poetry. There is not option like “–no-build-isolation” in poetry. Can anyone help me please?
Thanks.
How about add the version constraint bot to use setuptools 72.0.0 until the issue is resolved? It might be hassle for each uv user to apply the workaround to its environment.
We should lock build environments, see https://github.com/astral-sh/uv/issues/5190
Using the
--no-build-isolationflag works for me (uvcorrectly uses the installed version ofsetuptools)