Mac
python3.7
pip3 install torch
1、import torch后的报错信息:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/torch/__init__.py", line 136, in <module>
from torch._C import *
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/torch/_C.cpython-37m-darwin.so, 2): Library not loaded: @rpath/libc++.1.dylib
Referenced from: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/torch/_C.cpython-37m-darwin.so
Reason: image not found
2、解决方案来源:
https://github.com/cvxgrp/cvxpy/issues/807