I am trying to install detectron2 using Pip but I face this error:
MacBook-Air desktop % python -m pip install -e detectron2
Obtaining file:///Users/test/Desktop/detectron2
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [14 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/Users/test/Desktop/detectron2/setup.py", line 10, in <module>
import torch
File "/Users/test/opt/anaconda3/lib/python3.8/site-packages/torch/__init__.py", line 201, in <module>
_load_global_deps()
File "/Users/test/opt/anaconda3/lib/python3.8/site-packages/torch/__init__.py", line 154, in _load_global_deps
ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)
File "/Users/test/opt/anaconda3/lib/python3.8/ctypes/__init__.py", line 381, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen(/Users/test/opt/anaconda3/lib/python3.8/site-packages/torch/lib/libtorch_global_deps.dylib, 0x000A): Library not loaded: '@rpath/libmkl_intel_thread.dylib'
Referenced from: '/Users/test/opt/anaconda3/lib/python3.8/site-packages/torch/lib/libtorch_global_deps.dylib'
Reason: tried: '/Users/test/opt/anaconda3/lib/python3.8/site-packages/torch/lib/libmkl_intel_thread.dylib' (no such file), '/Users/test/opt/anaconda3/lib/python3.8/site-packages/torch/lib/../../../../libmkl_intel_thread.dylib' (no such file), '/Users/test/opt/anaconda3/lib/python3.8/site-packages/torch/lib/libmkl_intel_thread.dylib' (no such file), '/Users/test/opt/anaconda3/lib/python3.8/site-packages/torch/lib/../../../../libmkl_intel_thread.dylib' (no such file), '/Users/test/opt/anaconda3/lib/libmkl_intel_thread.dylib' (no such file), '/Users/test/opt/anaconda3/lib/libmkl_intel_thread.dylib' (no such file), '/Users/test/opt/anaconda3/lib/python3.8/lib-dynload/../../libmkl_intel_thread.dylib' (no such file), '/Users/test/opt/anaconda3/lib/libmkl_intel_thread.dylib' (no such file), '/Users/test/opt/anaconda3/bin/../lib/libmkl_intel_thread.dylib' (no such file), '/usr/local/lib/libmkl_intel_thread.dylib' (no such file), '/usr/lib/libmkl_intel_thread.dylib' (no such file)
[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.