Skip to content

Issue installing detectron2 on MacOS #5

@terrylinhaochen

Description

@terrylinhaochen

The build dependencies required for detectron2 were then installed successfully. However, when attempting to get the requirements to build the wheel a subprocess encountered an error and exited with code 1.The root cause of the error is a ModuleNotFoundError stating that the 'torch' module could not be found.

(environment) (vlog) Terris-MacBook-Pro:VLog-main terry$ CC=clang CXX=clang++ ARCHFLAGS="-arch x86_64" python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting git+https://github.com/facebookresearch/detectron2.git
Cloning https://github.com/facebookresearch/detectron2.git to /private/var/folders/sx/1sxy9xns737gtvyzc7mwvpvr0000gn/T/pip-req-build-lh5gjdn_
Running command git clone --filter=blob:none --quiet https://github.com/facebookresearch/detectron2.git /private/var/folders/sx/1sxy9xns737gtvyzc7mwvpvr0000gn/T/pip-req-build-lh5gjdn_
Resolved https://github.com/facebookresearch/detectron2.git to commit 47d8ed7a1bd999719825f2e8a11d5b2828bc02c4
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [17 lines of output]
Traceback (most recent call last):
File "/Users/terry/Desktop/VLog-main/environment/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in
main()
File "/Users/terry/Desktop/VLog-main/environment/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/Users/terry/Desktop/VLog-main/environment/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
File "/private/var/folders/sx/1sxy9xns737gtvyzc7mwvpvr0000gn/T/pip-build-env-c5yy4wd3/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "/private/var/folders/sx/1sxy9xns737gtvyzc7mwvpvr0000gn/T/pip-build-env-c5yy4wd3/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
self.run_setup()
File "/private/var/folders/sx/1sxy9xns737gtvyzc7mwvpvr0000gn/T/pip-build-env-c5yy4wd3/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 487, in run_setup
super(_BuildMetaLegacyBackend,
File "/private/var/folders/sx/1sxy9xns737gtvyzc7mwvpvr0000gn/T/pip-build-env-c5yy4wd3/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 338, in run_setup
exec(code, locals())
File "", line 10, in
ModuleNotFoundError: No module named 'torch'
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
(environment) (vlog) Terris-MacBook-Pro:VLog-main terry$

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions