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

Installation with poetry #340

Open
erickrf opened this issue Feb 5, 2024 · 2 comments
Open

Installation with poetry #340

erickrf opened this issue Feb 5, 2024 · 2 comments

Comments

@erickrf
Copy link

erickrf commented Feb 5, 2024

What is the proper way to install detrex with poetry? I use it for dependency management and cannot past installing detectron2.

I have tried poetry add with a local path, which I had never done before, and it threw me an error about not finding pytorch. This is weird, I have it installed and am using it in this environment.

$ poetry add --editable ./detrex/detectron2/

Unable to determine package info for path: /home/jovyan/obj-detection/detrex/detectron2

Command ['/tmp/tmpjdb7p6zw/.venv/bin/python', '-I', '-W', 'ignore', '-c', "import build\nimport build.env\nimport pyproject_hooks\n\nsource = '/home/jovyan/obj-detection/detrex/detectron2'\ndest = '/tmp/tmpjdb7p6zw/dist'\n\nwith build.env.DefaultIsolatedEnv() as env:\n    builder = build.ProjectBuilder(\n        source_dir=source,\n        python_executable=env.python_executable,\n        runner=pyproject_hooks.quiet_subprocess_runner,\n    )\n    env.install(builder.build_system_requires)\n    env.install(builder.get_requires_for_build('wheel'))\n    builder.metadata_path(dest)\n"] errored with the following return code 1

Error output:
Traceback (most recent call last):
  File "<string>", line 15, in <module>
  File "/tmp/tmpjdb7p6zw/.venv/lib/python3.10/site-packages/build/__init__.py", line 239, in get_requires_for_build
    with self._handle_backend(hook_name):
  File "/home/jovyan/.pyenv/versions/3.10.10/lib/python3.10/contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/tmp/tmpjdb7p6zw/.venv/lib/python3.10/site-packages/build/__init__.py", line 360, in _handle_backend
    raise BuildBackendException(exception, f'Backend subprocess exited when trying to invoke {hook}') from None
build._exceptions.BuildBackendException: Backend subprocess exited when trying to invoke get_requires_for_build_wheel

Fallback egg_info generation failed.

Command ['/tmp/tmpjdb7p6zw/.venv/bin/python', 'setup.py', 'egg_info'] errored with the following return code 1

Output:
Traceback (most recent call last):
  File "/home/jovyan/obj-detection/detrex/detectron2/setup.py", line 10, in <module>
    import torch
ModuleNotFoundError: No module named 'torch'

By the way, why not upload it to Pypi?

@rentainhe
Copy link
Collaborator

ModuleNotFoundError: No module named 'torch'

Seems like you should install PyTorch first before installing detrex

@erickrf
Copy link
Author

erickrf commented Feb 19, 2024

That's the point, I already have pytorch installed in that environment and have been using it already.

I believe poetry cannot find what is already installed in the environment when I try to install detectron2.

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

2 participants