Anaconda找不到OpenCV

时间:2016-04-30 12:15:56

标签: python opencv anaconda

我已经在Ubuntu中通过sudo apt-get install libopencv-dev安装了OpenCV,然后在Anaconda中安装了pip install python-opencv,但如果我尝试导入cv2模块,我会收到错误:

Python 2.7.11 |Anaconda 4.0.0 (64-bit)| (default, Dec  6 2015, 18:08:32) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
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://anaconda.org
>>> import cv2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named cv2
>>> 

我怎样才能让它发挥作用?

1 个答案:

答案 0 :(得分:1)

如果您想在Anaconda中安装OpenCV,您必须使用&#39; conda&#39;命令在终端。

我已经回答了类似的问题,您可以按照以下链接获取有关如何在Anaconda上安装它的详细说明。这是我回答的链接:

Installing opencv 3.1 with anaconda python3?

这是我用来安装它的命令。请注意,您必须具有互联网连接才能实现此目的。

conda install -c menpo opencv3

上面的命令将安装最新版本的OpenCV,即3.10。

我希望帮助你=)