MAC 遇到 import torch报错的一种情况

**

情况说明:

**
MAC已经安装了torch库,但是import torch报错;
错误提示:## ImportError: dlopen(/Users/chenxi/Documents/文档/程序/pycharm/torch/venv/lib/python3.7/site-packages/torch/_C.cpython-37m-darwin.so, 9): Library not loaded: /usr/local/opt/libomp/lib/libomp.dylib
Referenced from: /Users/chenxi/Documents/文档/程序/pycharm/torch/venv/lib/python3.7/site-packages/torch/lib/libshm.dylib
Reason: image not found

解决方案:
brew install libomp

你可能感兴趣的:(import,torch,报错,python,pytorch)