2013-06-06 116 views
2

我已经安装了Enthought Canopy Python 2.7.3 64位,它有OpenCV 2.4.2。当我import cv2我收到以下错误:Enthought Canopy Python和OpenCV

>>> 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 

This post suggests,该解决方案是运行install_name_tool -change...,但我不知道该怎么选择,通过它,并使用动态库,要了解这个人页不太熟悉不够,所以我转过来寻求帮助。

+0

我认为你使用的是Mac版本或Linux版本,而不是Windows,是否正确? –

+0

是的,这是osx。我现在标记了这个问题。 – mankoff

回答

0
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 

感谢原作者谁也回答完成线程在问题的链接。

相关问题