[英]Anaconda doesn't find module cv2
I am using Anaconda on OS X Mavericks. 我在OS X Mavericks上使用Anaconda。 When I try loading cv2
I get an import error (see below). 当我尝试加载cv2
我收到导入错误(见下文)。 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
. 我不确定它是否相关,但在/usr/local/lib/
我有libpng16.16.dylib
而不是libpng15.15.dylib
。
This is the solution I found: 这是我找到的解决方案:
PYTHONPATH
environment in ~/.bash_profile, as suggested by @asmeurer 按照@asmeurer的建议,在〜/ .bash_profile中注释PYTHONPATH
环境 作为建议这个问题,我简单地执行固定的这个问题
conda update hdf5
you could also just add it to your PYTHONPATH. 你也可以把它添加到你的PYTHONPATH。 here's how: you should be able to get it to load through one of the other (non anaconda) python executables. 这是如何:你应该能够通过其他(非anaconda)python可执行文件加载它。 mine were located at: /usr/bin/python (default system python) and /usr/local/bin/python (brew) 我的位于:/ usr / bin / python(默认系统python)和/ usr / local / bin / python(brew)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.