Unable to build OpenCV 3.3 + Python 2.7

asked 2017-11-29 09:11:13 -0500

Hi, I'm trying to build OpenCV 3.3 from source with Mingw in Windows 10 so that i can use SURF, SIFT, etc. I will use it with python 2.7, but i'm finding some troubles.

When I press Configure in CMake, the following errors appear:

Could NOT find PythonInterp: Found unsuitable version "2.7.14", but required is at least "3.4" (found C:/Python27/python.exe)

Could NOT find PythonInterp: Found unsuitable version "2.7.14", but required is at least "3.2" (found C:/Python27/python.exe)

Therefore (i guess), it also says that python2 is unavailable. image description

As you can see, i have python 2.7.14 installed, so i don´t understand why is it giving that error.

If I ignore that and I build and install it, i cannot import cv2 in python.

Does anybody know how can I make it work or why is it failing?

Thanks in advance :)

edit retag flag offensive close merge delete

Comments

since you already seem to use cmake-gui, there are some more related options to be filled, like the path to python includes, and libpython.a

you will also need a recent numpy version installed.

then, mingw might be a poor choice, there's no real support from opencv devs for that.

if it all fails, you could still try

pip install opencv_contrib_python

(actually works nice on win !)

berak gravatar imageberak ( 2017-11-29 09:28:55 -0500 )edit
1

@berak. The correct is pip install opencv-contrib-python not contrin_python

supra56 gravatar imagesupra56 ( 2017-11-29 11:06:10 -0500 )edit

@supra56, thanks for the correction ! (and both _ and - work the same)

berak gravatar imageberak ( 2017-11-29 11:34:00 -0500 )edit