albus_c albus_c - 4 months ago 40
Python Question

Anaconda doesn't find module cv2

I am using Anaconda on OS X Mavericks. When I try loading

cv2
I get an import error (see below). Do you know how to fix this?

>>import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen(/usr/local/Cellar/opencv/2.4.8.2/lib/python2.7/site-packages/cv2.so,
2): Library not loaded: /usr/local/lib/libpng15.15.dylib
Referenced from: /usr/local/Cellar/opencv/2.4.8.2/lib/libopencv_highgui.2.4.dylib
Reason: image not found


I am not sure it's relevant, but in
/usr/local/lib/
I have
libpng16.16.dylib
instead of
libpng15.15.dylib
.

Answer

This is the solution I found: