Ask Your Question

Compile OpenCV3.2 with Python2 on Windows 7

asked 2017-06-12 14:03:39 -0600

jbeale gravatar image

I am able to run cmake-gui with the default settings and compile and install OpenCV 3.2.0 with Visual Studio 14 2015 Win64 on Windows 7, if I don't use Python 2 or 3. The C++ samples programs work as expected.

I am now trying to compile, including WITH_PYTHON2 and WITH_XIMEA (I don't have Python 3 installed). Cmake finds the Python2.7 (64bit) files as follows:

PYTHON2_EXECUTABLE  C:/Python27/python.exe
PYTHON2_INCLUDE_DIR  C:/Python27/include
PYTHON2_LIBRARY C:/Python27/libs/python27.lib
PYTHON2_PACKAGES_PATH  C:/Python27/Lib/site-packages

but then concludes that both the python2 and python3 modules will be "Unavailable":`

 OpenCV modules:
    To be built:                 cudev core cudaarithm flann imgproc ml objdetect video cudabgsegm cudafilters cudaimgproc cudawarping imgcodecs photo shape videoio cudacodec highgui ts features2d calib3d cudafeatures2d cudalegacy cudaobjdetect cudaoptflow cudastereo stitching superres videostab
    Disabled:                    world
    Disabled by dependency:      -
    Unavailable:                 java python2 python3 viz`

What is missing? Do I need some PYTHON2_LIBRARY_DEBUG for this to work, if so where do I get that? Thanks for any hints!

edit retag flag offensive close merge delete


May be you can find some help in this tutorial. have you clone opencv?

LBerger gravatar imageLBerger ( 2017-06-12 14:30:49 -0600 )edit

your python2 install needs a recent numpy (10.x).

also, since there is no DEBUG library for python, it will only get built in RELEASE mode.

if you still can't get it to build, we need to see the complete cmake output

berak gravatar imageberak ( 2017-06-12 18:39:05 -0600 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2017-06-14 18:26:19 -0600

jbeale gravatar image

Thanks for the comments. I was able to get a python3 64-bit build after installing python3 with: 1) Run installer: Change default to install location C:\Python36

2) Then running C:\Python36\Scripts\pip3.exe install "package_amd64.whl" for these packages:

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2017-06-12 14:03:39 -0600

Seen: 383 times

Last updated: Jun 14 '17