I am trying to deploy my app to Streamlit
and it requires detectron2
. I had to install detectron2
using
python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'
It requires torch
to be already present as it'll throw an error there and then.
so when I did, pip freeze requirements.txt
, the snippet looks like:
torch==1.12.1
torchaudio==0.12.1
torchvision==0.13.1
detectron2 @ git+https://github.com/facebookresearch/detectron2.git@717ab9f0aeca216a2f800e43d705766251ba3a55
so when I pip install -r requirements.txt
, it gives me error as:
Collecting detectron2@ git+https://github.com/facebookresearch/detectron2.git@717ab9f0aeca216a2f800e43d705766251ba3a55
Cloning https://github.com/facebookresearch/detectron2.git (to revision 717ab9f0aeca216a2f800e43d705766251ba3a55) to /tmp/pip-install-60odo0ml/detectron2_3c0ef1b35e7b42cd95cfd938e09dd4d5
Running command git clone --filter=blob:none --quiet https://github.com/facebookresearch/detectron2.git /tmp/pip-install-60odo0ml/detectron2_3c0ef1b35e7b42cd95cfd938e09dd4d5
Running command git rev-parse -q --verify 'sha^717ab9f0aeca216a2f800e43d705766251ba3a55'
Running command git fetch -q https://github.com/facebookresearch/detectron2.git 717ab9f0aeca216a2f800e43d705766251ba3a55
Resolved https://github.com/facebookresearch/detectron2.git to commit 717ab9f0aeca216a2f800e43d705766251ba3a55
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
Traceback (most recent call last):
File "<string>", line 36, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-60odo0ml/detectron2_3c0ef1b35e7b42cd95cfd938e09dd4d5/setup.py", line 10, in <module>
import torch
ModuleNotFoundError: No module named 'torch'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.