Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to install daphne: ModuleNotFoundError: No module named 'setuptools.command.test' #518

Closed
hassanthegeek opened this issue Jul 29, 2024 · 9 comments

Comments

@hassanthegeek
Copy link

hassanthegeek commented Jul 29, 2024

setuptools have removed the command setuptools.command.test, which was deprecated in release 41.5.0 almost 5 years ago, but looks like daphne is still using it.

Stack Trace

#0 21.30 
#0 21.30   Backend subprocess exited when trying to invoke get_requires_for_build_wheel
#0 21.30   
#0 21.30   Traceback (most recent call last):
#0 21.30     File "/usr/local/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in <module>
#0 21.30       main()
#0 21.30     File "/usr/local/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 357, in main
#0 21.30       json_out["return_val"] = hook(**hook_input["kwargs"])
#0 21.30                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#0 21.30     File "/usr/local/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 134, in get_requires_for_build_wheel
#0 21.30       return hook(config_settings)
#0 21.30              ^^^^^^^^^^^^^^^^^^^^^
#0 21.30     File "/tmp/tmp_t4z1__v/.venv/lib/python3.11/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel
#0 21.30       return self._get_build_requires(config_settings, requirements=[])
#0 21.30              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#0 21.30     File "/tmp/tmp_t4z1__v/.venv/lib/python3.11/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
#0 21.30       self.run_setup()
#0 21.30     File "/tmp/tmp_t4z1__v/.venv/lib/python3.11/site-packages/setuptools/build_meta.py", line 497, in run_setup
#0 21.30       super().run_setup(setup_script=setup_script)
#0 21.30     File "/tmp/tmp_t4z1__v/.venv/lib/python3.11/site-packages/setuptools/build_meta.py", line 313, in run_setup
#0 21.30       exec(code, locals())
#0 21.30     File "<string>", line 32, in <module>
#0 21.30   ModuleNotFoundError: No module named 'setuptools.command.test'
#0 21.30   
#0 21.30 
#0 21.30   at /usr/local/lib/python3.11/site-packages/poetry/installation/chef.py:164 in _prepare
#0 21.31       160│ 
#0 21.31       161│                 error = ChefBuildError("\n\n".join(message_parts))
#0 21.31       162│ 
#0 21.31       163│             if error is not None:
#0 21.31     → 164│                 raise error from None
#0 21.31       165│ 
#0 21.31       166│             return path
#0 21.31       167│ 
#0 21.31       168│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:
#0 21.31 
#0 21.31 Note: This error originates from the build backend, and is likely not a problem with poetry but with autobahn (23.6.2) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "autobahn (==23.6.2)"'.
#0 21.31 

My Environment
I am using Ubuntu 22.04.2 LTS, and trying to install latest daphne 4.1.2 via poetry in my dockerized setup.

@hassanthegeek hassanthegeek changed the title ModuleNotFoundError: No module named 'setuptools.command.test' unable to install daphne: ModuleNotFoundError: No module named 'setuptools.command.test' Jul 29, 2024
@NonaryR
Copy link

NonaryR commented Jul 29, 2024

This issue caused by this update - https://setuptools.pypa.io/en/stable/history.html#v72-0-0

This is stack overflow comment about problem - https://stackoverflow.com/a/78806146

But I'm personally can't pin setuptools = "<72.0.0" in my pyproject.toml because of this

Incompatible constraints in requirements of PROJECT (0.1.0):
setuptools (==71.1.0)
setuptools (>=72.0.0,<73.0.0)

@carltongibson
Copy link
Member

@carltongibson
Copy link
Member

This doesn't reproduce for my using pip...

$ pip install daphne
...
Successfully installed asgiref-3.8.1 attrs-23.2.0 autobahn-23.6.2 automat-22.10.0 cffi-1.16.0 constantly-23.10.4 cryptography-43.0.0 daphne-4.1.2 hyperlink-21.0.0 idna-3.7 incremental-24.7.1 pyasn1-0.6.0 pyasn1-modules-0.4.0 pycparser-2.22 pyopenssl-24.2.1 service-identity-24.1.0 setuptools-72.0.0 six-1.16.0 tomli-2.0.1 twisted-24.3.0 txaio-23.1.1 typing-extensions-4.12.2 zope-interface-6.4.post2

@kallyas
Copy link

kallyas commented Jul 29, 2024

Same Issue here

Collecting autobahn>=22.4.2 (from daphne==4.1.2->-r requirements.txt (line 26))
  Downloading autobahn-23.6.2.tar.gz (480 kB)
  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 'error'
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [17 lines of output]
      Traceback (most recent call last):
        File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-x3urz8jf/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
        File "/tmp/pip-build-env-x3urz8jf/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line [297](https://github.com/xxxxxxxxx/actions/runs/10143972122/job/28046487098#step:5:298), in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-x3urz8jf/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 497, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-x3urz8jf/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 313, in run_setup
          exec(code, locals())
        File "<string>", line 32, in <module>
      ModuleNotFoundError: No module named 'setuptools.command.test'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
Error: Process completed with exit code 1.

@carltongibson
Copy link
Member

No need for more duplicate posts. Thanks.

Comments towards fixes welcome, but is it not the upstream autobahn issue that needs resolving?

@NonaryR
Copy link

NonaryR commented Jul 29, 2024

Updating to setuptools==72.1.0 solved this
See comment about hot fix from setuptools repo

@sterliakov
Copy link

@carltongibson yes, that problem is on autobahn side, and daphne doesn't need any relevant changes - the build system here is already modern. This issue can be safely closed, I believe.

Autobahn also resolved the problem, but the updated version is not released yet (crossbario/autobahn-python#1644).

@carltongibson
Copy link
Member

Thanks @sterliakov 🎁 — I'll leave it open for the moment, just for visibility.

@carltongibson
Copy link
Member

I assume this have worked through now. Closing.

@carltongibson carltongibson closed this as not planned Won't fix, can't repro, duplicate, stale Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants