I have tried installing OpenCV from source. It installs perfectly for python 2.7 and python 3.5, but isn't installing for python 3.6.
I built it using the following command:
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D PYTHON_EXECUTABLE=/usr/bin/python3.6 ..
The output shows:
-- Python 3:
-- Interpreter: /usr/bin/python3 (ver 3.5.2)
-- Libraries: /usr/lib/x86_64-linux-gnu/libpython3.5m.so (ver 3.5.2)
-- numpy: /home/courts/.local/lib/python3.5/site-packages/numpy/core/include (ver 1.12.0)
-- packages path: lib/python3.5/dist-packages
--
-- Python (for build): /usr/bin/python3
And when I make install
the OpenCV library becomes present in the dist-packages folder for python3.5, but not python3.6.
This is in the build log:
-- Found PythonInterp: /usr/bin/python3.6 (found suitable version "3.6.2", minimum required is "2.7")
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.5.2", minimum required is "3.4")
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.5m.so (found suitable exact version "3.5.2")