Opencv found unsuitable version "1.4" but required is at least 3.6 I can only quote the error from memory since I cannot scroll far enough back in tmux and I do not want to reproduce the error. but then failed, saying it did not find them. DPYTHON_LIBRARY=$(python -c "import distutils.sysconfig as sysconfig print(sysconfig.get_config_var('LIBDIR'))")Īt this point, cmake was finding the correct python interpreter and libraries. DPYTHON_INCLUDE_DIR=$(python -c "from distutils.sysconfig import get_python_inc print(get_python_inc())") \ Or directly in the cmake command: $ cmake. Some of these pathes can be found using python itself such as python3.6 -c "from distutils.sysconfig import get_python_inc print(get_python_inc())" I was mindlessly trying out until I got something to work. Note that it is likely that many of these do not make sense. After following Aurelius' Answer and some trying out, I built this cmake command: cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D INSTALL_PYTHON_EXAMPLES=ON -D INSTALL_C_EXAMPLES=ON -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules -D BUILD_EXAMPLES=ON -D PYTHON_EXECUTABLE=/usr/local/bin/python3.6/ -D PYTHON_INCLUDE=/usr/local/include/python3.6m/ -D PYTHON_LIBRARY=/usr/local/lib/python3.6/ -D PYTHON_PACKAGES_PATH=/usr/local/lib/python3.6/site-packages/ -D PYTHON_NUMPY_INCLUDE_DIR=/usr/local/lib/python3.6/dist-packages/numpy/core/include/ -D PYTHON_INCLUDE_DIR=/usr/local/include/python3.6m/ -D PYTHON_LIBRARY=/usr/local/lib/ -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D INSTALL_PYTHON3_EXAMPLES=ON -D INSTALL_C_EXAMPLES=ON -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules -D BUILD_EXAMPLES=ON -D PYTHON3_INCLUDE=/usr/local/include/python3.6m/ -D PYTHON3_LIBRARY=/usr/local/lib/python3.6/ -D PYTHON3_PACKAGES_PATH=/usr/local/lib/python3.6/site-packages/ -D PYTHON3_NUMPY_INCLUDE_DIR=/usr/local/lib/python3.6/dist-packages/numpy/core/include/ -D PYTHON3_INCLUDE_DIR=/usr/local/include/python3.6m/ -D PYTHON3_LIBRARY=/usr/local/lib/. I had python 2.7 and 3.4 installed already, and built python 3.6 myself in /usr/local/bin. It tells you whether it found the Python Interpreter. Pay attention to the start of the cmake output. D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules # it is also possible to write python3.6 to refer to the python version 3.6 command Pip3.6 install numpy # note that we specify the pip version after the command Sudo apt-get install python2.7-dev & sudo apt-get install python3-dev Git clone & cd opencv &git checkout 3.0.0 Originally, I was following this guide which can be summarized as follows: sudo apt-get update & sudo apt-get upgrade & sudo apt-get install build-essential git cmake pkg-config libjpeg8-dev libtiff4-dev libjasper-dev libpng12-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libgtk2.0-dev libatlas-base-dev gfortran This issue took me a day and I still am unsure how I solved it, but here are a few pointers in case the given answers alone don't help: This is a low-quality answer but it is still very useful if you have been trying for ten hours and need some new ideas. So, my question is that is there any way to explicitly specify the version of python? Make: *** Error 2Īpparently it uses a new format that python2.4 does not support. packages path: lib/python2.4/site-packagesĪnd later in building opencv gives me this error: Generating pyopencv_generated_funcs.h, pyopencv_generated_func_tab.h, pyopencv_generated_types.h, pyopencv_generated_type_reg.h, pyopencv_generated_const_reg.hįile "/home/mmoghimi/opencv-2.4.5/modules/python/src2/gen2.py", line 815Ĭname1=("cv::Algorithm" if classinfo.isalgorithm else classinfo.cname))) numpy: /usr/lib64/python2.4/site-packages/numpy/core/include (ver 1.2.1) Libraries: /usr/lib64/python2.4/config/libpython2.4.a Interpreter: /usr/bin/python2.4 (ver 2.4) It detects the python 2.4 as the current installation: - Python: cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_NEW_PYTHON_SUPPORT=ON -D BUILD_EXAMPLES=ON. I'm trying to install OpenCV(2.4.5) for the 2.7 version. I have two different versions of python installed on my machine: 2.4 and 2.7.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |