I've got the Enthought Canopy Python distribution on Windows, and I'd like to add the OpenCV python bindings.
I have downloaded the latest OpenCV from http://sourceforge.net/projects/opencvlibrary/ but I don't see any setup.py file.
So I'm wondering: What is the best way to install OpenCV on windows to have it working under Enthought Canopy Python?
I stumbled on this same issue. Here's what I did:
C:\RPS\python\epd32
C:\RPS\python\epd32\opencv\build\python\2.7
. Save this .pth
file in your Enthought Canopy user site packages folder, for example: C:\Users\rsignell\AppData\Local\Enthought\Canopy32\User\Lib\site-packages\opencv.pth
Open Enthought Canopy and try typing import cv2
. It should now work!
I do it this way because I like having the whole OpenCV distro on my system, with the examples and other stuff.
But if you don't want the whole OpenCV distro hanging around, you could also just copy <opencv>\build\python\2.7\cv2.pyd
into your site-packages
directory and then delete the directory that OpenCV unpacked everything into.
Or to avoid extracting everything, you could open the opencv.exe using with something like 7-zip (open inside) and extract just <opencv>\build\python\2.7\cv2.pyd
into your site-packages
directory.