Я пытаюсь импортировать torch
, но не удалось из-за ошибки Image not Found
. Вот ошибка, когда я ввел import torch
:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
in
----> 1 import torch
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/torch/__init__.py in
134 # See Note [Global dependencies]
135 _load_global_deps()
--> 136 from torch._C import *
137
138 __all__ += [name for name in dir(_C)
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/torch/_C.cpython-38-darwin.so, 2): Library not loaded: @rpath/libc++.1.dylib
Referenced from: /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/torch/_C.cpython-38-darwin.so
Reason: image not found
Большое спасибо!
РЕДАКТИРОВАТЬ: Это работает для меня:
>>> install_name_tool -add_rpath /usr/lib /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/torch/_C.cpython-38-darwin.so