ubuntu系统下导入python-opencv问题
这个问题在开源里面问过,但是一直都没有准确的回音:
import cvimport time
if __name__ == '__main__':
cv.NamedWindow("camera",1)
capture = cv.CaptureFromCAM(0)
while True:
img = cv.QueryFrame(capture)
cv.ShowImage("camera",img)
mm = int(time.strftime('%S',time.localtime()))
if mm == 30:
filename = "e:\pic\o\%s.jpg" % time.strftime('%Y%m%d%H%M%S',time.localtime())
#time.sleep(2)
cv.SaveImage(filename,img)
if cv.WaitKey(10) == 27:
break
cv.DestroyWindow("camera")
同时使用dpkg -L python-opencv命令查看如下:
报错代码如下:
Traceback (most recent call last):
File "/home/ubulinux/application/untitled/thenewtest.py", line 2, in
import cv
ImportError: No module named cv
Process finished with exit code 1
就算是将 import cv 改成 import cv2也不行,还是一样的报错
同时需要声明的是我使用的是ubuntu 12.10系统
SYS-PATCH ['/home/ubulinux/application/untitled',
'/home/ubulinux/application/untitled',
'/usr/lib/python3.2',
'/usr/lib/python3.2/plat-linux2',
'/usr/lib/python3.2/lib-dynload',
'/usr/local/lib/python3.2/dist-packages',
'/usr/lib/python3/dist-packages']
回答:
http://www.cnblogs.com/freshm... 这篇博文用sudo pip3 install opencv-python解决的
以上是 ubuntu系统下导入python-opencv问题 的全部内容, 来源链接: utcz.com/a/161413.html