【发布时间】:2015-02-03 04:50:47
【问题描述】:
我用 home-brew 安装了 opencv 并在 python 中运行了命令import cv,它给出了以下错误。
我使用的是 MAC OS 10.10。
有什么问题?
Jays-MacBook-Air:caffe jay$ brew install opencv
Warning: opencv-2.4.10.1 already installed
Jays-MacBook-Air:caffe jay$ python
Python 2.7.9 |Anaconda 2.1.0 (x86_64)| (default, Dec 15 2014, 10:37:34)
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://binstar.org
>>> import cv
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named cv
>>>
什么是错误?
需要给opencv设置路径吗?
谢谢你:)
【问题讨论】:
-
是的,你应该检查 ~/.bash_profile 中的
PYTHONPATH -
导出 PYTHONPATH=$HOME/work/vislab-git:$PYTHONPATH
-
我应该把它设置在哪里?我有anaconda python和普通python!