简体   繁体   中英

Enthought Canopy Python and OpenCV

I've installed Enthought Canopy Python 2.7.3 64-bit and it has OpenCV 2.4.2. When I import cv2 I get the following error:

>>> 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 that the solution is to run install_name_tool -change... but I do not know what options to pass it, and am not familiar enough with dynamic libraries to understand the man page, so I turn here for help.

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

感谢原始作者,他还回答了问题链接中的完成主题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM