I use Python 3.4 through Anaconda distribution. They don't seem to have Python 3.4 bindings for OpenCV. I tried to use Cmake from the source, but to no avail. Could anybody please help me to install OpenCV for Python 3.4.x?
There are two major versions of Python, Python2, and Python3. We will be covering the latest version of Python throughout the tutorials as it supports newer features. The OpenCV doesn't care much about the version of Python, the bindings will work just the same.
conda install -c menpo opencv3
Does the trick. However you have to have anaconda installed.
There are many tutorials and questions (on SO) about this.
This seems to answer your question. Edit: Reproduced below:
1) Download OpenCV from http://opencv.org/downloads.html and extract
2)From the extracted folder, copy the file from the extracted directory:
opencv/build/python/2.7/(either x86 or x64, depending on your Anaconda
version)/cv2.pyd to your Anaconda site-packages directory, e.g.,
C:\Anaconda\Lib\site-packages
3)To get ffmpeg within opencv to work, you'll have to add the directory
that ffmpeg is located in to the path (e.g., opencv/sources/3rdparty
/ffmpeg). Then you'll have to find the dll in that folder (e.g.,
opencv_ffmpeg_64.dll) and copy or rename it to a filename that includes
the opencv version you are installing, (e.g., opencv_ffmpeg249_64) for
2.4.9.
{End Reproduction}
EDIT2: OpenCV doesn't support Python 3.x except for OpenCV version 3.0 (still experimental, in beta). Download the 3.0 version from the download site and try that.(Thanks to this question).
A SO question with a possible tip, if the previous doesn't work.
And finally, I will point you to a read the docs tutorial on how to install it.
Good luck!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With