我正在安装OpenCV以在我的Mac上使用Python http://www.jeffreythompson.org/blog/2013/08/22/update-installing-opencv-on-mac-mountain-lion/
我安装了所有东西没有问题,但最后我得到了这个有线问题,提到“OpenCV库”没有连接
$ pkg-config --cflags opencv
-I/usr/local/include/opencv -I/usr/local/include
$ brew install opencv
Warning: opencv-2.4.6.1 already installed, it's just not linked
$ python
Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named cv
>>> import cv
答案 0 :(得分:1)
对于它的价值,我认为你错过了my instructions中的一步。您需要将以下行添加到主文件夹中的.bash_profile
文件中(如果文件不存在,则创建它):
export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH
确保在启动Python之前重启终端。
答案 1 :(得分:0)