我正在使用 Mac OS X(雪豹)并尝试使用 python 绑定安装 opencv,但是当我尝试导入 cv 模块时出现以下错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cv.py", line 3, in <module>
from cv2.cv import *
ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cv2.so, 2): Symbol not found: _av_alloc_format_context
Referenced from: /usr/local/lib/libopencv_highgui.2.4.dylib
Expected in: /opt/local/lib/libavformat.dylib
in /usr/local/lib/libopencv_highgui.2.4.dylib
我添加了以下路径:export PYTHONPATH=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages:$PYTHONPATH
到我的~/.profile
有谁知道我该如何解决?