opencv with non default python executable
Hello
Following the manual of opencv-3.2, I used the following command
cmake -D CMAKE_BUILD_TYPE=Release \\
-D CMAKE_INSTALL_PREFIX=/opt/opencv-3.2.0/built/ \\
-D PYTHON2\(3\)_EXECUTABLE=/opt/python/bin/python3.3 \\
..
I expect that the compiler uses python 3.3, however, the output of the cmake command shows
-- Python 2:
-- Interpreter: /usr/bin/python2 (ver 2.6.6)
--
-- Python 3:
-- Interpreter: NO
--
-- Python (for build): /usr/bin/python2
What did I miss in the command line?
can you do without the
\\
? they look all suspicious.then it's
PYTHON3_EXECUTABLE
(again, no slashes or braces)also remember, that you'll need the python-dev headers & libs, + current numpy installed
This time, I see
Interpreter: /usr/bin/python2 (ver 2.6.6)
andInterpreter: /opt/python/bin/python3.3 (ver 3.3.6)
andPython (for build): /usr/bin/python2
. What does that mean?It means that it is aware of the path for both Python 2 and Python 3 interpreters, and it is using Python 2 for the build process. I've successfully built the OpenCV bindings for the Python 3 interpreter when Python 2 is being used for the build process so you should be fine. If CMake is not auto detecting the other Python related build variables you may want to specify those as well. See step 4 in Installation in Linux