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

Can't add package (pyqpbo) #11161

Closed
noamgot opened this issue Feb 2, 2025 · 2 comments
Closed

Can't add package (pyqpbo) #11161

noamgot opened this issue Feb 2, 2025 · 2 comments
Labels
error messages Messaging when something goes wrong

Comments

@noamgot
Copy link

noamgot commented Feb 2, 2025

Summary

I tried adding the pyqpbo package to a fresh uv-initialized project

uv init --python 3.10
uv python pin 3.10

I got this error:

❯ uv add pyqpbo
  × Failed to build `pyqpbo==0.1.2`
  ├─▶ The build backend returned an error
  ╰─▶ Call to `setuptools.build_meta:__legacy__.build_wheel` failed (exit status: 1)

      [stderr]
      Traceback (most recent call last):
        File "<string>", line 14, in <module>
        File "$HOME/.cache/uv/builds-v0/.tmpOpYTfz/lib/python3.10/site-packages/setuptools/build_meta.py", line 334, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
        File "$HOME/.cache/uv/builds-v0/.tmpOpYTfz/lib/python3.10/site-packages/setuptools/build_meta.py", line 304, in _get_build_requires
          self.run_setup()
        File "$HOME/.cache/uv/builds-v0/.tmpOpYTfz/lib/python3.10/site-packages/setuptools/build_meta.py", line 522, in run_setup
          super().run_setup(setup_script=setup_script)
        File "$HOME/.cache/uv/builds-v0/.tmpOpYTfz/lib/python3.10/site-packages/setuptools/build_meta.py", line 320, in run_setup
          exec(code, locals())
        File "<string>", line 5, in <module>
      ModuleNotFoundError: No module named 'numpy'

      hint: This usually indicates a problem with the package or the build environment.
  help: `pyqpbo` (v0.1.2) was included because `pyqpbo-test` (v0.1.0) depends on `pyqpbo`

I know this is a very old package, but I must use it in my project.

For reference, when I create a clean venv I can pip install pyqpbo and use it:

python3.10 -m venv .venv
source .venv/bin/activate
pip install pyqpbo # works!
pip install numpy==1.25 # we must install it to make the next line work
python -c "from pyqpbo import alpha_expansion_general_graph"  # works!

Notes:

  • I installed numpy in the venv example just to make the import work. pyqpbo's installation works without it. It doesn't work in the uv case either with or without numpy installed.
  • The full context is that I tried to install it within a pixi (conda) environment, but since they use uv as their pypi installation backend, I checked it in a fresh uv project and got the same error I got with pixi.

If you have a solution for this - I'd like to hear about it. thanks!

Platform

Ubuntu 22.04, Linux 5.15.0-88-generic x86_64 GNU/Linux

Version

uv 0.5.25

Python version

3.10.12

@noamgot noamgot added the bug Something isn't working label Feb 2, 2025
@konstin
Copy link
Member

konstin commented Feb 2, 2025

This is another instance of #2252, pyqpbo fails to declare its build dependency on numpy. You can work around this by installing numpy manually (as you did) and then deactivating build isolation for the package (https://docs.astral.sh/uv/concepts/projects/config/#build-isolation).

We should add a better hint here for ModuleNotFoundError: No module named '.*'

@konstin konstin added error messages Messaging when something goes wrong and removed bug Something isn't working labels Feb 2, 2025
@noamgot
Copy link
Author

noamgot commented Feb 2, 2025

thanks @konstin , looks like it's good enough for me (and works in pixi as well :) )

@noamgot noamgot closed this as completed Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error messages Messaging when something goes wrong
Projects
None yet
Development

No branches or pull requests

2 participants