Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
175 views
in Technique[技术] by (71.8m points)

python - No module named cv

I'm trying to run this script:

https://github.com/openalpr/train-detector/blob/master/crop_plates.py

I've never dealt with python before. First of all I had some syntax errors in the print lines. They were lacking parentheses...but I'm not sure if I get this error because of the Python version I installed or this was indeed a syntax error. After fixing the syntax error I'm receiving the following error:

C:>py crop_plates.py
Traceback (most recent call last):
File "crop_plates.py", line 7, in <module>
import cv2, cv
ImportError: No module named cv

I did the following:

Installed Python 2.7.5 32 bits.

Installed numpy 1.9.1 32 bits (also tried different versions)

Installed matplotlib 1.3.0.

Installed OpenCv

Copied cv2.pyd from

C:UsersMeDownloadsopencvuildpython2.7x86

to

C:Python27Libsite-packages

But I can't find anywhere the cv.pyd file that I'm missing.

I found references to this guide for installing Opencv but it's not working http://opencv.willowgarage.com/documentation/python/

Thank you very much,

Edit: I'm running Python in Windows 7.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

For ImportError: No module named cv, try installing opencv-python module using below command:

pip install opencv-python

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...