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

Installing detectron2 errors out ("ModuleNotFoundError: No module named 'torch' even though torch is part of the environment) #8330

Closed
4 tasks done
ldorigo opened this issue Aug 18, 2023 · 6 comments
Labels
kind/question User questions (candidates for conversion to discussion) status/external-issue Issue is caused by external project (platform, dep, etc)

Comments

@ldorigo
Copy link

ldorigo commented Aug 18, 2023

  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

I am trying to add Detectron2 (https://detectron2.readthedocs.io/en/latest/) to my project. I am using a very recent version of pytorch for other reasons, so I first installed a nightly build of torch/torchvision (see pyproject.toml), and am now trying to add detectron2 from this pull request facebookresearch/detectron2#4868 :

poetry -vvv add git+https://github.com/johnnynunez/detectron2.git

I am getting the following output: https://gist.github.com/ldorigo/4bcc4b270cf24afbab3f9d20810c82a8

I am not sure whether this is an issue with Poetry or the upstream package, if so let me know and I will open an issue there.

@ldorigo ldorigo added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Aug 18, 2023
@dimbleby
Copy link
Contributor

it's a detectron packaging problem, as you can verify with pip install --use-pep517 <package-name>

please close

@dimbleby
Copy link
Contributor

also duplicate #3712, so please close it twice!

@ldorigo
Copy link
Author

ldorigo commented Aug 18, 2023

Sorry I missed that issue. Since apparently upstream Detectron2 facebookresearch/detectron2#4234 does not want to fix the issue, is there anything that can be done to include detectron2 in a poetry project?

@dimbleby
Copy link
Contributor

no

@Secrus Secrus closed this as not planned Won't fix, can't repro, duplicate, stale Aug 18, 2023
@radoering
Copy link
Member

You can build wheels (with other means than poetry) and add them. (You probably need one wheel for each platform and python version you want to support.)

@radoering radoering added kind/question User questions (candidates for conversion to discussion) status/external-issue Issue is caused by external project (platform, dep, etc) and removed kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Aug 18, 2023
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/question User questions (candidates for conversion to discussion) status/external-issue Issue is caused by external project (platform, dep, etc)
Projects
None yet
Development

No branches or pull requests

4 participants