Here is the situation.
I'm compiling opencv in a dedicated anaconda environment, called opencv3.
The cmake options I have specified for python are:
-DPYTHON_LIBRARY=PATH2ANACONDA/envs/opencv3/lib/
libpython3.5.so-DPYTHON_INCLUDE_DIR=PATH2ANACONDA/envs/opencv3/include/python3.5m
-DPYTHON_EXECUTABLE=PATH2ANACONDA/envs/opencv3/bin/python3.5
-DPYTHON_PACKAGES_PATH=PATH2ANACONDA/envs/opencv3/lib/python3.5/site-packages
Yet, cmake throws the following intriguing 3 lines:
-- Found PythonInterp: /home/ludovic/anaconda3/envs/opencv3/bin/python3.5 (found suitable version "3.5.2", minimum required is "2.7")
-- Found PythonInterp: /usr/bin/python3.4 (found suitable version "3.4.3", minimum required is "3.4")
-- Could NOT find PythonLibs: Found unsuitable version "3.5.2", but required is exact version "3.4.3" (found /home/ludovic/anaconda3/envs/opencv3/lib/
libpython3.5.so)
This says that the python interpreter I have specified is first correctly located, but then the system wide python is used as is the python library.
And cmake then tells me:
-- Python 3:
-- Interpreter: /usr/bin/python3.4 (ver 3.4.3)
--
-- Python (for build): /usr/bin/python3.4
Why is cmake not using the one I have specified?
Is there another cmake option I should specify?
cmake reference:
https://cmake.org/cmake/help/v3.0/module/FindPythonLibs.htmlLudovic