I am unable to get OpenCV to run in python. [closed]
I have installed OpenCV and tried to use it in python. I have tried to install it normally and by building it from the source as instructing on the openCV website. These are the errors i am given.
I am unable to attach screenshots of the errors because i am a new member and dont have enough karma so i will type out the errors.
The installation guide I followed
When i try to use "import cv2" in idle python i get the error:
Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> import cv2 ImportError: No module named 'cv2'
And when i try to build from source CMake returns the error:
CMake Error: The source directory "C:/opencv" does not appear to contain CMakeLists.txt. Specify --help for usage, or press the help button on the CMake GUI.
I Cant figure out the problem. Is anyone able to explain why it isnt working and what i need to do to make it work.
Thanks very much>
what steps did you do, exactly ?
to use cv2.pyd from a prebuild binary package, you should copy it to python/lib/site-packages. did you do that ?
I did that exactly. I followed the steps at this link multiple times.
http://docs.opencv.org/3.2.0/d5/de5/tutorial_py_setup_in_windows.html (http://docs.opencv.org/3.2.0/d5/de5/t...)
your link is broken.
added some karma, so you can addlinks/images properly now, but please add that to your question, not in a comment.
If you get the message
ImportError: No module named 'cv2'
then basically your python installation is not able to find the cv2 binary for python. Place it in the correct location!I copied cv2.pyd into python/lib/site-packages as instructed in the installation guide?
you might be having two python installation.. try to remove all python from control panel as well as from the folder where you are pasting cv2.pyd and then create a clean python installation.. try after that
@Codacus, how would that be an issue? I have been running python2 and python3 installations next to each other for ages and that works just fine.
I was having a doubt that you are pasting cv2.pyd in one version of the python and when using python you are running the other version..