python - Building OpenCV cmake error: could NOT find PythonInterp -
to build opencv, ran in terminal in ~/opencv/build directory :
cmake -d cmake_build_type=release -d cmake_install_prefix=/path/to/opencv-3.0.0/build -d python2_library=/usr/local/cellar/python/2.7.11/frameworks/python.framework/versions/2.7/bin -d python2_include_dir=/usr/local/frameworks/python.framework/headers -d python2_packages_path=/usr/local/lib/python2.7/site-packages -d install_c_examples=on -d install_python_examples=on -d build_examples=on -d opencv_extra_modules_path=/path/to/opencv_contrib-3.0.0/modules ../
but no matter happens, see error in traceback : (could not find pythoninterp:)
traceback (most recent call last): file "<string>", line 1, in <module> importerror: no module named numpy.distutils -- not find pythoninterp: found unsuitable version "2.7.11", required @ least "3.4" (found /usr/local/bin/python) -- not find pythoninterp: found unsuitable version "2.7.11", required @ least "3.2" (found /usr/local/bin/python)
further down line, shows up
-- python 2:
-- interpreter: /usr/local/bin/python2.7 (ver 2.7.11)
-- python 3:
-- interpreter: no
-- python (for build): /usr/local/bin/python2.7
-- java: -- ant: no -- jni:
the correct output should this: correct python interp output
i have tried everything, keeps coming up! in essence, cannot build opencv properly, , hence cannot install properly.
your error talks not being able find numpy, install numpy:
pip install numpy
in addition, change include directory make sure including it. python2_include_dir
:
-d python2_include_dir=/usr/local/frameworks/python.framework/headers
then, run make clean
, , delete /build
directory, , run cmake
, make
again.
Comments
Post a Comment