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

Fails to install detectron2 package from git #4600

Closed
alfa07 opened this issue Jun 27, 2024 · 5 comments
Closed

Fails to install detectron2 package from git #4600

alfa07 opened this issue Jun 27, 2024 · 5 comments

Comments

@alfa07
Copy link

alfa07 commented Jun 27, 2024

 ❯ uv pip install -r requirements-2.txt
 Updated https://github.com/facebookresearch/detectron2.git (e2ce8dc)
error: Failed to download and build: `detectron2 @ git+https://github.com/facebookresearch/detectron2.git@e2ce8dc#egg=detectron2`
  Caused by: Failed to build: `detectron2 @ git+https://github.com/facebookresearch/detectron2.git@e2ce8dc#egg=detectron2`
  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 "/Users/maxim/Library/Caches/uv/environments-v0/.tmpOkCWJn/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 "/Users/maxim/Library/Caches/uv/environments-v0/.tmpOkCWJn/lib/python3.10/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
    self.run_setup()
  File "/Users/maxim/Library/Caches/uv/environments-v0/.tmpOkCWJn/lib/python3.10/site-packages/setuptools/build_meta.py", line 497, in run_setup
    super().run_setup(setup_script=setup_script)
  File "/Users/maxim/Library/Caches/uv/environments-v0/.tmpOkCWJn/lib/python3.10/site-packages/setuptools/build_meta.py", line 313, in run_setup
    exec(code, locals())
  File "<string>", line 10, in <module>
ModuleNotFoundError: No module named 'torch'

torch is already installed:

 ❯ uv pip list | rg torch
torch                      2.3.1
torchvision                0.18.1

uv version:

 ❯ uv --version
uv 0.2.17

python version:

❯ python --version
Python 3.10.11

requirements-2.txt:

detectron2@git+https://github.com/facebookresearch/detectron2.git@e2ce8dc#egg=detectron2
@charliermarsh
Copy link
Member

It looks like you need to run with --no-build-isolation.

@charliermarsh
Copy link
Member

(detectron2 doesn't declare torch as a build-time dependency, so you're responsible for installing it ahead-of-time and then disabling build dependencies entirely.)

@zanieb
Copy link
Member

zanieb commented Jun 27, 2024

See also #2252

@alfa07
Copy link
Author

alfa07 commented Jun 28, 2024

Thank you! The project is amazing - I do hope we will get rust like experience in python - that would be awesome. The --no-build-isolation flag works!

@alfa07
Copy link
Author

alfa07 commented Jun 28, 2024

It looks like it is an issue with detectron2 as mentioned in #2252 - closing.

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

3 participants