【发布时间】:2014-05-30 19:40:25
【问题描述】:
我正在尝试按照为 python 找到的说明here。
第 1 步似乎有效,这是我运行 opencv.sh 后终端的最后 5 行代码:
h.h
./opencv.sh: line 16: cmake: command not found
make: *** No targets specified and no makefile found. Stop.
sudo: checkinstall: command not found
OpenCV 2.4.9 ready to be used
但是,当我进入第 2 步时,从命令行运行 python 文件时出现以下错误:
Traceback (most recent call last):
File "opencvFirst.py", line 4, in '<'module'>'
from cv2.cv import *
ImportError: No module named cv2.cv
This 似乎不是我的问题,因为我在我的计算机上找不到 cv2.anything,这很可能是问题的一部分,但我不知道为什么第 1 步不会已经安装好了。
我认为this question 更接近我的需要,但由于我已经完成了第 1 步,正如我上面所说,我不确定从哪里开始使用这些单独的说明。我试过import cv2,但导入错误:no module cv2.
我对 ubuntu、python 和所有这些命令行的东西都很陌生,谢谢你的帮助!
哦,还有,我应该说:我的最终目标只是让 OpenCV 正常工作,所以如果有更简单/更好的方法可以做到这一点,我非常愿意接受建议。
【问题讨论】:
-
除了下面@julienc 的回答,请避免使用旧的cv2.cv 模块,它不会在下一个opencv 版本中存在
标签: python linux opencv ubuntu