Enthoud Canopy Python和OpenCV
我已经安装了64位Python 2.7.3,它有OpenCV 2.4.2。当我导入cv2时,我得到以下错误:Enthoud Canopy Python和OpenCV,python,macos,opencv,enthought,canopy,Python,Macos,Opencv,Enthought,Canopy,我已经安装了64位Python 2.7.3,它有OpenCV 2.4.2。当我导入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-
>>> 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
导入cv2
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
ImportError:dlopen(/Users/Foo/Library/enthund/Canopy_64bit/User/lib/python2.7/site-packages/cv2.so,2):未加载库:@executable_path/。/Python
引用自:/Users/Foo/Library/enthund/Canopy_64bit/User/lib/python2.7/site-packages/cv2.so
原因:找不到图像
解决方案是运行install\u name\u tool-change…
,但我不知道传递它的选项是什么,而且我对动态库不太熟悉,无法理解手册页,因此我在这里寻求帮助
install_name_tool -change @executable_path/../Python $HOME/Library/Enthought/Canopy_64bit/User/Python $HOME/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/cv2.so
感谢原作者,他也回答了在问题中的链接处完成线程。我认为您使用的是Mac版本或Linux版本,而不是Windows,对吗?是的,这是osx。我现在已经把问题加上标签了。