2013-06-06 114 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 

感謝原作者誰也回答完成線程在問題的鏈接。

相關問題