Ask Your Question
0

Building OpenCV 3.2 with opencv_contrib for Python 3.6 on Window

asked 2017-04-04 15:41:47 -0600

Serpent10i gravatar image

updated 2017-04-09 23:05:37 -0600

Hello All,

I am attempting to build 3.2 for Python 3.6, on windows 10. I have not seen a specifically OpenCV 3.2 for Python 3.6 tutorial but I have been using these as reference.

Tutorial 1 stackoverflow.com/questions/37517983/opencv-install-opencv-contrib-on-windows

Tutorial 2 docs.opencv.org/3.2.0/d5/de5/tutorial_py_setup_in_windows.html

I have set up MS Visual Studio 2015 with Python Tools (from the install) and CMake.

Here is my CMake-GUI

Image 1 i.imgur.com/At9rosb.png

Image 2 i.imgur.com/TfyGe4e.png

And the text output from configure:

output.txt pastebin.com/FQsgsYF9


The CXX compiler identification is MSVC 19.0.24215.1 The C compiler identification is MSVC 19.0.24215.1 Check for working CXX compiler: D:/Visual_Studio_for_OpenCV/Install_15/VC/bin/cl.exe Check for working CXX compiler: D:/Visual_Studio_for_OpenCV/Install_15/VC/bin/cl.exe -- works Detecting CXX compiler ABI info Detecting CXX compiler ABI info - done Detecting CXX compile features Detecting CXX compile features - done Check for working C compiler: D:/Visual_Studio_for_OpenCV/Install_15/VC/bin/cl.exe Check for working C compiler: D:/Visual_Studio_for_OpenCV/Install_15/VC/bin/cl.exe -- works Detecting C compiler ABI info Detecting C compiler ABI info - done Found PythonInterp: C:/Program Files/Python36/python.exe (found suitable version "3.6.1", minimum required is "2.7") Found PythonInterp: C:/Program Files/Python36/python.exe (found suitable version "3.6.1", minimum required is "3.4") Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) (Required is exact version "3.6.1") Performing Test HAVE_CXX_FSIGNED_CHAR Performing Test HAVE_CXX_FSIGNED_CHAR - Failed Performing Test HAVE_C_FSIGNED_CHAR Performing Test HAVE_C_FSIGNED_CHAR - Failed Performing Test HAVE_CPU_SSE3_SUPPORT (check file: cmake/checks/cpu_sse3.cpp) Performing Test HAVE_CPU_SSE3_SUPPORT - Success Performing Test HAVE_CPU_SSSE3_SUPPORT (check file: cmake/checks/cpu_ssse3.cpp) Performing Test HAVE_CPU_SSSE3_SUPPORT - Success Performing Test HAVE_CPU_SSE4_1_SUPPORT (check file: cmake/checks/cpu_sse41.cpp) Performing Test HAVE_CPU_SSE4_1_SUPPORT - Success Performing Test HAVE_CPU_POPCNT_SUPPORT (check file: cmake/checks/cpu_popcnt.cpp) Performing Test HAVE_CPU_POPCNT_SUPPORT - Failed POPCNT is not supported by C++ compiler Performing Test HAVE_CPU_SSE4_2_SUPPORT (check file: cmake/checks/cpu_sse42.cpp) Performing Test HAVE_CPU_SSE4_2_SUPPORT - Failed SSE4_2 is not supported by C++ compiler Performing Test HAVE_CPU_FP16_SUPPORT (check file: cmake/checks/cpu_fp16.cpp) Performing Test HAVE_CPU_FP16_SUPPORT - Success Performing Test HAVE_CXX_ARCH:AVX (check file: cmake/checks/cpu_avx.cpp) Performing Test HAVE_CXX_ARCH:AVX - Success Performing Test HAVE_CXX_ARCH:AVX2 (check file: cmake/checks/cpu_avx2.cpp) Performing Test HAVE_CXX_ARCH:AVX2 - Success Performing Test HAVE_CPU_BASELINE_FLAGS Performing Test HAVE_CPU_BASELINE_FLAGS - Success Performing Test HAVE_CPU_DISPATCH_FLAGS_SSE4_1 Performing Test HAVE_CPU_DISPATCH_FLAGS_SSE4_1 - Success Performing Test HAVE_CPU_DISPATCH_FLAGS_FP16 Performing Test HAVE_CPU_DISPATCH_FLAGS_FP16 - Success Performing Test HAVE_CPU_DISPATCH_FLAGS_AVX Performing Test HAVE_CPU_DISPATCH_FLAGS_AVX - Success Performing Test HAVE_CPU_DISPATCH_FLAGS_AVX2 Performing Test HAVE_CPU_DISPATCH_FLAGS_AVX2 - Success FP16: Compiler support is available Check if the system is big endian Searching 16 bit integer Looking for sys/types.h Looking for sys/types.h - found Looking for stdint.h Looking for stdint.h - found Looking for stddef.h Looking for stddef.h - found Check size of unsigned short Check size of unsigned short - done Using unsigned short Check if the system is big endian - little endian Looking for fseeko Looking for fseeko ...

(more)
edit retag flag offensive close merge delete

Comments

please add the cmake output to your question , (and please as text, not a screenshot...)

berak gravatar imageberak ( 2017-04-04 20:27:58 -0600 )edit

"When I go into VS2015, I don't find any python compile options" -- if you see an opencv_python project, you're good to go ! you'll probably have to switch to RELEASE mode (it won't be built for DEBUG), and run the INSTALL target

berak gravatar imageberak ( 2017-04-05 01:39:19 -0600 )edit

see line 15 of your output:

Could NOT find PythonLibs (missing:  PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) (Required is exact version "3.6.1")

you need to add the path to python include dirs, and to python3???.lib to cmake options.

unless python3 does not show up in the "to be build" section, it's no use starting VS even.

berak gravatar imageberak ( 2017-04-06 05:49:08 -0600 )edit

Berak - Sorry about that, it was a link to the txt, but I've added the raw text now. I was running release, but that was not the issue. I did have python3.6 in my path

Serpent10i gravatar imageSerpent10i ( 2017-04-09 23:05:12 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-04-09 23:07:30 -0600

Serpent10i gravatar image

I figured out the issue, I was using VS 14 2015, and apparently it defaults to 32 bit. I needed to be using 64 bit compiler for my 64 bit python install... simple mistake, easily fixable using the setting in cmake.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-04-04 15:41:47 -0600

Seen: 1,450 times

Last updated: Apr 09 '17