linux - How to build OpenCV for both python versions 2 and 3? -


in opencv linux install doc, section building opencv source using cmake said run command like

cmake -d cmake_build_type=release -d cmake_install_prefix=/usr/local .. 

simultaneously, there given parameters python:

[optional] building python. set following python parameters: python2(3)_executable = <path python> python_include_dir = /usr/include/python<version> python_include_dir2 = /usr/include/x86_64-linux-gnu/python<version> python_library = /usr/lib/x86_64-linux-gnu/libpython<version>.so python2(3)_numpy_include_dirs = /usr/lib/python<version>/dist-packages/numpy/core/include/ 

some of these parameters can set both version of python:

cmake -d cmake_build_type=release -d cmake_install_prefix=/usr/local -d python2_executable=/usr/bin/python -d python3_executable=/usr/bin/python3  .. 

but ones ambiguous

python_include_dir = /usr/include/python<version> 

is possible build both versions of python @ once?

no, bindings binary modules (compiled c) different in python 2 , python 3. same built libs cannot used python 2 , python 3.

but may run build instructions python 2, python 3 using distinct cmake_install_prefix values.


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -