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 mamba-ssm with uv #4354

Closed
kszlim opened this issue Jun 17, 2024 · 6 comments
Closed

Unable to install mamba-ssm with uv #4354

kszlim opened this issue Jun 17, 2024 · 6 comments
Labels
question Asking for clarification or support

Comments

@kszlim
Copy link

kszlim commented Jun 17, 2024

# in an environment with all mamba-ssm requirements installed, cuda, torch, etc.
uv pip install mamba-ssm # will fail

uv version:
uv 0.2.11 on linux

Error:

uv pip install mamba-ssm
⠙ mamba-ssm==2.0.4                                                                                                                                                                                                                                            error: Failed to download and build `mamba-ssm==2.0.4`
  Caused by: Failed to build: `mamba-ssm==2.0.4`
  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 "/path/to/home/.cache/uv/environments-v0/.tmpnxysd8/lib/python3.12/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
    return self._get_build_requires(config_settings, requirements=['wheel'])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/path/to/home/.cache/uv/environments-v0/.tmpnxysd8/lib/python3.12/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
    self.run_setup()
  File "/path/to/home/.cache/uv/environments-v0/.tmpnxysd8/lib/python3.12/site-packages/setuptools/build_meta.py", line 487, in run_setup
    super().run_setup(setup_script=setup_script)
  File "/path/to/home/.cache/uv/environments-v0/.tmpnxysd8/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup
    exec(code, locals())
  File "<string>", line 8, in <module>
ModuleNotFoundError: No module named 'packaging'
@kszlim kszlim changed the title Unable to install mamba-ssm with uv Unable to install mamba-ssm with uv Jun 17, 2024
@kidrahahjo
Copy link

kidrahahjo commented Jun 17, 2024

I get a similar error when I try to install with pip directly, I suspect this is unrelated to uv. But I will let the maintainers suggest

image

[Update]

When I manually install packaging, pip works but uv still can't resolve packaging

@kszlim
Copy link
Author

kszlim commented Jun 17, 2024

I've managed to get it installed with pip before, it does require that you pip install packaging first though.

@konstin
Copy link
Member

konstin commented Jun 17, 2024

For packages like this one that doesn't declare its build dependencies, you need to install packaging manually and use --no-build-isolation.

@konstin konstin added the question Asking for clarification or support label Jun 17, 2024
@kszlim
Copy link
Author

kszlim commented Jun 17, 2024

@konstin I believe that packaging is declared as a build dep here? But I could be misunderstanding.

Using uv as you've directed did manage to work for me, however, I'm trying to get it to work with pixi, which might need some work upstream. Thanks!

@konstin
Copy link
Member

konstin commented Jun 17, 2024

The install_requires are declared at the bottom of the setup.py, but packaging is imported at the top, before we get to install_requires. The solution is to add a pyproject.toml with a [build-system] table so uv can install the dependencies of setup.py before running setup.py. You can find more information on build backends here, many more details about the build-system vs. setup.py and how pyproject.toml solves it are described in PEP 517.

@zanieb
Copy link
Member

zanieb commented Jun 17, 2024

See #2252 — build isolation will become the default in pip in the future too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Asking for clarification or support
Projects
None yet
Development

No branches or pull requests

5 participants