Skip to content Skip to sidebar Skip to footer

Opencv For Python 3.x Under Windows

I've been searching around the Internet for a while but I have not been able to find detailed instructions on how to install OpenCV for Python 3.x under Windows. I would really app

Solution 1:

For those on Windows who don't want to mess with building OpenCV 3.0 from source, Christoph Gohlke maintains Windows binaries for many Python packages, including OpenCV 3.0 with Python 3.x bindings! See here:

http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv

To install, just download the 64-bit or 32-bit .whl file appropriate for your system, then run pip install [filename]. Then the instruction import cv2 should work in your Python 3.x interpreter.

Solution 2:

OpenCV 3 added python 3+ support. It is still in alpha and there are a lot of known bugs with it and python at the moment. The final version of OpenCV 3 will be released by the end of the year.

If you download the OpenCV 3 alpha executable from the website, you can build the support for python 3. Alternatively, you can get the latest code from their github. You will also have to install CMake and Python 3. Open up CMake and it will ask where the source code is. If you downloaded the executable, it will be located where ever you extracted the executable at in the sources folder. If you downloaded the latest build, it is wherever you downloaded that. Select the folder and in CMake, hit configure and it will ask you which compiler you want to use. After that, you can see everything you can build in OpenCV. As of OpenCV 3, there is an option for Python3. Check that and anything else you might want, and hit generate. That will make a project within your compiler of choice that you can build, and that will build all of the library's you need.

While this guide is made for 2.4.9, it works for 3.0. You will just see different options within 3. http://docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html

Post a Comment for "Opencv For Python 3.x Under Windows"