我已经安装了 Enthought Canopy Python 2.7.3 64 位,它有 OpenCV 2.4.2。当我import cv2
收到以下错误时:
>>> import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen(/Users/Foo/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/cv2.so, 2): Library not loaded: @executable_path/../Python
Referenced from: /Users/Foo/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/cv2.so
Reason: image not found
这篇文章建议解决方案是运行install_name_tool -change...
,但我不知道传递它的选项,并且对动态库不够熟悉以理解手册页,所以我转向这里寻求帮助。