在 anaconda3 中安装 openCV - Python.h: 没有那个文件或目录
Installing openCV in anaconda3 - Python.h: No such file or directory
我正在尝试为我的 anaconda3 安装构建 opencv 3.1.0,但我的构建失败了:
[ 94%] Building CXX object modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.o
/home/mikel/Soft/opencv/modules/python/src2/cv2.cpp:6:20: fatal error: Python.h: No such file or directory
compilation terminated.
我通过在两者中使用 git checkout 3.1.0
将 opencv 和 opencv-contrib 与版本 3.1.0 一起克隆,我正在尝试在 ~/Soft/opencv/build
中构建,其中我在 [=17= 中有 opencv-contrib ].我正在 运行宁 Ubuntu GNOME 15.10 和 i7-4960X。
我的主要目标是让 opencv 在我的 anaconda3 安装中工作,所以我的 cmake 命令如下:
cmake \
-D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_C_EXAMPLES=OFF \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/Soft/opencv_contrib/modules \
-D PYTHON3_EXECUTABLE=/home/mikel/anaconda3/bin/python3.5 \
-D PYTHON3_INCLUDE_DIR=/home/mikel/anaconda3/include/ \
-D PYTHON3_LIBRARY=/home/mikel/anaconda3/lib/libpython3.5m.so \
-D PYTHON3_PACKAGES_PATH=/home/mikel/anaconda3/lib/python3.5/site-packages/ \
-D PYTHON3_NUMPY_INCLUDE_DIRS=/home/mikel/anaconda3/lib/python3.5/site-packages/numpy/core/include \
-D PYTHON_DEFAULT_AVAILABLE=/home/mikel/anaconda3/bin/python3.5 \
-D BUILD_EXAMPLES=ON ..
我的 cmake 命令的输出在这里:http://pastebin.com/qtd1wyMb - 据我所知,一切正常。
然后我 运行 make -j12
安装 opencv 并在几次警告后它 运行 没问题,直到 94%,我得到以下输出:
Scanning dependencies of target opencv_python3
[ 94%] Building CXX object modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.o
/home/mikel/Soft/opencv/modules/python/src2/cv2.cpp:6:20: fatal error: Python.h: No such file or directory
compilation terminated.
modules/python3/CMakeFiles/opencv_python3.dir/build.make:278: recipe for target 'modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.o' failed
make[2]: *** [modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.o] Error 1
CMakeFiles/Makefile2:18929: recipe for target 'modules/python3/CMakeFiles/opencv_python3.dir/all' failed
make[1]: *** [modules/python3/CMakeFiles/opencv_python3.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 94%] Building CXX object modules/stitching/CMakeFiles/opencv_perf_stitching.dir/perf/perf_main.cpp.o
[ 94%] Built target opencv_test_optflow
[ 94%] [ 94%] Building CXX object samples/cpp/CMakeFiles/cpp-tutorial-pnp_registration.dir/tutorial_code/calib3d/real_time_pose_estimation/src/CsvWriter.cpp.o
Building CXX object samples/cpp/CMakeFiles/cpp-tutorial-pnp_detection.dir/tutorial_code/calib3d/real_time_pose_estimation/src/CsvReader.cpp.o
[ 94%] [ 94%] Building CXX object samples/cpp/CMakeFiles/cpp-tutorial-pnp_registration.dir/tutorial_code/calib3d/real_time_pose_estimation/src/ModelRegistration.cpp.o
Building CXX object modules/stitching/CMakeFiles/opencv_test_stitching.dir/test/ocl/test_warpers.cpp.o
[ 94%] Building CXX object modules/stitching/CMakeFiles/opencv_perf_stitching.dir/perf/opencl/perf_stitch.cpp.o
Linking CXX executable ../../bin/cpp-example-bgfg_segm
Linking CXX executable ../../bin/cpp-example-autofocus
[ 94%] Building CXX object samples/cpp/CMakeFiles/cpp-tutorial-pnp_detection.dir/tutorial_code/calib3d/real_time_pose_estimation/src/CsvWriter.cpp.o
[ 94%] Building CXX object samples/cpp/CMakeFiles/cpp-tutorial-pnp_detection.dir/tutorial_code/calib3d/real_time_pose_estimation/src/ModelRegistration.cpp.o
[ 94%] Linking CXX executable ../../bin/opencv_test_tracking
Building CXX object samples/cpp/CMakeFiles/cpp-tutorial-pnp_registration.dir/tutorial_code/calib3d/real_time_pose_estimation/src/Mesh.cpp.o
[ 94%] Built target example_bgfg_segm
[ 94%] [ 94%] Built target example_autofocus
Building CXX object samples/cpp/CMakeFiles/cpp-tutorial-pnp_registration.dir/tutorial_code/calib3d/real_time_pose_estimation/src/Model.cpp.o
[ 94%] [ 94%] Building CXX object samples/cpp/CMakeFiles/cpp-tutorial-pnp_registration.dir/tutorial_code/calib3d/real_time_pose_estimation/src/Utils.cpp.o
Building CXX object samples/cpp/CMakeFiles/cpp-tutorial-pnp_registration.dir/tutorial_code/calib3d/real_time_pose_estimation/src/PnPProblem.cpp.o
[ 94%] Building CXX object samples/cpp/CMakeFiles/cpp-tutorial-pnp_detection.dir/tutorial_code/calib3d/real_time_pose_estimation/src/Mesh.cpp.o
[ 94%] Built target opencv_test_tracking
[ 94%] Building CXX object samples/cpp/CMakeFiles/cpp-tutorial-pnp_detection.dir/tutorial_code/calib3d/real_time_pose_estimation/src/Model.cpp.o
[ 94%] Building CXX object samples/cpp/CMakeFiles/cpp-tutorial-pnp_detection.dir/tutorial_code/calib3d/real_time_pose_estimation/src/PnPProblem.cpp.o
[ 94%] Building CXX object samples/cpp/CMakeFiles/cpp-tutorial-pnp_detection.dir/tutorial_code/calib3d/real_time_pose_estimation/src/Utils.cpp.o
[ 94%] Building CXX object samples/cpp/CMakeFiles/cpp-tutorial-pnp_registration.dir/tutorial_code/calib3d/real_time_pose_estimation/src/RobustMatcher.cpp.o
[ 94%] Building CXX object samples/cpp/CMakeFiles/cpp-tutorial-pnp_detection.dir/tutorial_code/calib3d/real_time_pose_estimation/src/RobustMatcher.cpp.o
[ 94%] Building CXX object modules/stitching/CMakeFiles/opencv_perf_stitching.dir/perf/opencl/perf_warpers.cpp.o
Linking CXX executable ../../bin/cpp-example-3calibration
[ 94%] Building CXX object modules/stitching/CMakeFiles/opencv_test_stitching.dir/test/test_main.cpp.o
[ 94%] Built target example_3calibration
Linking CXX executable ../../bin/opencv_test_stitching
[ 94%] Built target opencv_test_stitching
Linking CXX executable ../../bin/cpp-tutorial-pnp_registration
[ 94%] Built target cpp-tutorial-pnp_registration
Linking CXX executable ../../bin/cpp-tutorial-pnp_detection
[ 94%] Built target cpp-tutorial-pnp_detection
Linking CXX executable ../../bin/opencv_perf_stitching
[ 94%] Built target opencv_perf_stitching
Makefile:146: recipe for target 'all' failed
make: *** [all] Error 2
make 的完整输出在这里供参考:http://pastebin.com/1zNgsckZ
看来我的问题是因为我使用的是 anaconda3 路径而不是标准的 python3 路径,它无法再找到 Python.h。但是,当我使用系统安装python3安装时,我无法将opencv导入到我需要的anaconda中。
我安装了 python3-dev 和 python-dev,所以 Python.h 应该在我的机器上。我需要更改什么才能使 openCV 找到 Python.h?
编辑: 我发现 Anaconda3 的 Python.h 在 anaconda3/include/python3.5m/ 所以我设置 PYTHON3_INCLUDE_DIR=anaconda3/include/python3.5m/
现在我得到一个不同的错误:
Scanning dependencies of target opencv_python3
Linking CXX executable ../../bin/opencv_test_optflow
[ 91%] Building CXX object modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.o
In file included from /home/mikel/Soft/opencv/build/modules/python3/pyopencv_generated_include.h:11:0,
from /home/mikel/Soft/opencv/modules/python/src2/cv2.cpp:12:
/home/mikel/Soft/opencv_contrib/modules/hdf/include/opencv2/hdf/hdf5.hpp:40:18: fatal error: hdf5.h: No such file or directory
compilation terminated.
modules/python3/CMakeFiles/opencv_python3.dir/build.make:278: recipe for target 'modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.o' failed
make[2]: *** [modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.o] Error 1
CMakeFiles/Makefile2:18929: recipe for target 'modules/python3/CMakeFiles/opencv_python3.dir/all' failed
make[1]: *** [modules/python3/CMakeFiles/opencv_python3.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
我解决了这个问题。问题是 PYTHON3_INCLUDE_DIR
被设置为 ~/anaconda3/include
而 Anaconda 的 Python.h 实际上在 ~/anaconda3/include/python3.5m
里面。设置 PYTHON3_INCLUDE_DIR=anaconda3/include/python3.5m/
解决了这个问题,因为它现在看到 Python.h
然而,这导致了另一个问题,其中一些 .h 文件(例如 hdf5.h
和 H5public.h
不再对 OpenCV 可见,因为它们位于主 anaconda3/include/ 目录中,不在子文件夹中。
解决方案是将所有 .h 文件从 include/
目录复制到 include/python3.5m
目录 (将两者的内容复制到另一个目录并设置因为路径也可以工作) 这样所有的 .h 文件都在编译器可见的同一文件夹中。 OpenCV 现已构建!
通过在配置 cmake
之前设置 CPLUS_INCLUDE_PATH
变量解决
export CPLUS_INCLUDE_PATH=$(python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())")
然后配置cmake为
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D INSTALL_C_EXAMPLES=OFF \
-D WITH_TBB=ON \
-D WITH_CUDA=ON \
-D BUILD_opencv_cudacodec=OFF \
-D ENABLE_FAST_MATH=1 \
-D CUDA_FAST_MATH=1 \
-D WITH_CUBLAS=1 \
-D WITH_V4L=ON \
-D WITH_QT=OFF \
-D WITH_OPENGL=ON \
-D WITH_GSTREAMER=ON \
-D OPENCV_GENERATE_PKGCONFIG=ON \
-D OPENCV_PC_FILE_NAME=opencv.pc \
-D OPENCV_ENABLE_NONFREE=ON \
-D OPENCV_EXTRA_MODULES_PATH=/home/udara/Documents/research/opencv/opencv-contrib-source/modules \
-D BUILD_EXAMPLES=ON \
-D HAVE_opencv_python3=ON \
-D OPENCV_PYTHON3_INSTALL_PATH=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") \
-D PYTHON3_PACKAGES_PATH=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") \
-D PYTHON_EXECUTABLE=$(which python) \
-D PYTHON_INCLUDE_DIR=$(python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \
-D PYTHON_LIBRARY=/home/udara/anaconda3/envs/jupyter/lib/libpython3.so ../opencv-source
文件夹结构
├── build
├── opencv-contrib-source
└── opencv-source
我正在尝试为我的 anaconda3 安装构建 opencv 3.1.0,但我的构建失败了:
[ 94%] Building CXX object modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.o
/home/mikel/Soft/opencv/modules/python/src2/cv2.cpp:6:20: fatal error: Python.h: No such file or directory
compilation terminated.
我通过在两者中使用 git checkout 3.1.0
将 opencv 和 opencv-contrib 与版本 3.1.0 一起克隆,我正在尝试在 ~/Soft/opencv/build
中构建,其中我在 [=17= 中有 opencv-contrib ].我正在 运行宁 Ubuntu GNOME 15.10 和 i7-4960X。
我的主要目标是让 opencv 在我的 anaconda3 安装中工作,所以我的 cmake 命令如下:
cmake \
-D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_C_EXAMPLES=OFF \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/Soft/opencv_contrib/modules \
-D PYTHON3_EXECUTABLE=/home/mikel/anaconda3/bin/python3.5 \
-D PYTHON3_INCLUDE_DIR=/home/mikel/anaconda3/include/ \
-D PYTHON3_LIBRARY=/home/mikel/anaconda3/lib/libpython3.5m.so \
-D PYTHON3_PACKAGES_PATH=/home/mikel/anaconda3/lib/python3.5/site-packages/ \
-D PYTHON3_NUMPY_INCLUDE_DIRS=/home/mikel/anaconda3/lib/python3.5/site-packages/numpy/core/include \
-D PYTHON_DEFAULT_AVAILABLE=/home/mikel/anaconda3/bin/python3.5 \
-D BUILD_EXAMPLES=ON ..
我的 cmake 命令的输出在这里:http://pastebin.com/qtd1wyMb - 据我所知,一切正常。
然后我 运行 make -j12
安装 opencv 并在几次警告后它 运行 没问题,直到 94%,我得到以下输出:
Scanning dependencies of target opencv_python3
[ 94%] Building CXX object modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.o
/home/mikel/Soft/opencv/modules/python/src2/cv2.cpp:6:20: fatal error: Python.h: No such file or directory
compilation terminated.
modules/python3/CMakeFiles/opencv_python3.dir/build.make:278: recipe for target 'modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.o' failed
make[2]: *** [modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.o] Error 1
CMakeFiles/Makefile2:18929: recipe for target 'modules/python3/CMakeFiles/opencv_python3.dir/all' failed
make[1]: *** [modules/python3/CMakeFiles/opencv_python3.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 94%] Building CXX object modules/stitching/CMakeFiles/opencv_perf_stitching.dir/perf/perf_main.cpp.o
[ 94%] Built target opencv_test_optflow
[ 94%] [ 94%] Building CXX object samples/cpp/CMakeFiles/cpp-tutorial-pnp_registration.dir/tutorial_code/calib3d/real_time_pose_estimation/src/CsvWriter.cpp.o
Building CXX object samples/cpp/CMakeFiles/cpp-tutorial-pnp_detection.dir/tutorial_code/calib3d/real_time_pose_estimation/src/CsvReader.cpp.o
[ 94%] [ 94%] Building CXX object samples/cpp/CMakeFiles/cpp-tutorial-pnp_registration.dir/tutorial_code/calib3d/real_time_pose_estimation/src/ModelRegistration.cpp.o
Building CXX object modules/stitching/CMakeFiles/opencv_test_stitching.dir/test/ocl/test_warpers.cpp.o
[ 94%] Building CXX object modules/stitching/CMakeFiles/opencv_perf_stitching.dir/perf/opencl/perf_stitch.cpp.o
Linking CXX executable ../../bin/cpp-example-bgfg_segm
Linking CXX executable ../../bin/cpp-example-autofocus
[ 94%] Building CXX object samples/cpp/CMakeFiles/cpp-tutorial-pnp_detection.dir/tutorial_code/calib3d/real_time_pose_estimation/src/CsvWriter.cpp.o
[ 94%] Building CXX object samples/cpp/CMakeFiles/cpp-tutorial-pnp_detection.dir/tutorial_code/calib3d/real_time_pose_estimation/src/ModelRegistration.cpp.o
[ 94%] Linking CXX executable ../../bin/opencv_test_tracking
Building CXX object samples/cpp/CMakeFiles/cpp-tutorial-pnp_registration.dir/tutorial_code/calib3d/real_time_pose_estimation/src/Mesh.cpp.o
[ 94%] Built target example_bgfg_segm
[ 94%] [ 94%] Built target example_autofocus
Building CXX object samples/cpp/CMakeFiles/cpp-tutorial-pnp_registration.dir/tutorial_code/calib3d/real_time_pose_estimation/src/Model.cpp.o
[ 94%] [ 94%] Building CXX object samples/cpp/CMakeFiles/cpp-tutorial-pnp_registration.dir/tutorial_code/calib3d/real_time_pose_estimation/src/Utils.cpp.o
Building CXX object samples/cpp/CMakeFiles/cpp-tutorial-pnp_registration.dir/tutorial_code/calib3d/real_time_pose_estimation/src/PnPProblem.cpp.o
[ 94%] Building CXX object samples/cpp/CMakeFiles/cpp-tutorial-pnp_detection.dir/tutorial_code/calib3d/real_time_pose_estimation/src/Mesh.cpp.o
[ 94%] Built target opencv_test_tracking
[ 94%] Building CXX object samples/cpp/CMakeFiles/cpp-tutorial-pnp_detection.dir/tutorial_code/calib3d/real_time_pose_estimation/src/Model.cpp.o
[ 94%] Building CXX object samples/cpp/CMakeFiles/cpp-tutorial-pnp_detection.dir/tutorial_code/calib3d/real_time_pose_estimation/src/PnPProblem.cpp.o
[ 94%] Building CXX object samples/cpp/CMakeFiles/cpp-tutorial-pnp_detection.dir/tutorial_code/calib3d/real_time_pose_estimation/src/Utils.cpp.o
[ 94%] Building CXX object samples/cpp/CMakeFiles/cpp-tutorial-pnp_registration.dir/tutorial_code/calib3d/real_time_pose_estimation/src/RobustMatcher.cpp.o
[ 94%] Building CXX object samples/cpp/CMakeFiles/cpp-tutorial-pnp_detection.dir/tutorial_code/calib3d/real_time_pose_estimation/src/RobustMatcher.cpp.o
[ 94%] Building CXX object modules/stitching/CMakeFiles/opencv_perf_stitching.dir/perf/opencl/perf_warpers.cpp.o
Linking CXX executable ../../bin/cpp-example-3calibration
[ 94%] Building CXX object modules/stitching/CMakeFiles/opencv_test_stitching.dir/test/test_main.cpp.o
[ 94%] Built target example_3calibration
Linking CXX executable ../../bin/opencv_test_stitching
[ 94%] Built target opencv_test_stitching
Linking CXX executable ../../bin/cpp-tutorial-pnp_registration
[ 94%] Built target cpp-tutorial-pnp_registration
Linking CXX executable ../../bin/cpp-tutorial-pnp_detection
[ 94%] Built target cpp-tutorial-pnp_detection
Linking CXX executable ../../bin/opencv_perf_stitching
[ 94%] Built target opencv_perf_stitching
Makefile:146: recipe for target 'all' failed
make: *** [all] Error 2
make 的完整输出在这里供参考:http://pastebin.com/1zNgsckZ
看来我的问题是因为我使用的是 anaconda3 路径而不是标准的 python3 路径,它无法再找到 Python.h。但是,当我使用系统安装python3安装时,我无法将opencv导入到我需要的anaconda中。
我安装了 python3-dev 和 python-dev,所以 Python.h 应该在我的机器上。我需要更改什么才能使 openCV 找到 Python.h?
编辑: 我发现 Anaconda3 的 Python.h 在 anaconda3/include/python3.5m/ 所以我设置 PYTHON3_INCLUDE_DIR=anaconda3/include/python3.5m/
现在我得到一个不同的错误:
Scanning dependencies of target opencv_python3
Linking CXX executable ../../bin/opencv_test_optflow
[ 91%] Building CXX object modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.o
In file included from /home/mikel/Soft/opencv/build/modules/python3/pyopencv_generated_include.h:11:0,
from /home/mikel/Soft/opencv/modules/python/src2/cv2.cpp:12:
/home/mikel/Soft/opencv_contrib/modules/hdf/include/opencv2/hdf/hdf5.hpp:40:18: fatal error: hdf5.h: No such file or directory
compilation terminated.
modules/python3/CMakeFiles/opencv_python3.dir/build.make:278: recipe for target 'modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.o' failed
make[2]: *** [modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.o] Error 1
CMakeFiles/Makefile2:18929: recipe for target 'modules/python3/CMakeFiles/opencv_python3.dir/all' failed
make[1]: *** [modules/python3/CMakeFiles/opencv_python3.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
我解决了这个问题。问题是 PYTHON3_INCLUDE_DIR
被设置为 ~/anaconda3/include
而 Anaconda 的 Python.h 实际上在 ~/anaconda3/include/python3.5m
里面。设置 PYTHON3_INCLUDE_DIR=anaconda3/include/python3.5m/
解决了这个问题,因为它现在看到 Python.h
然而,这导致了另一个问题,其中一些 .h 文件(例如 hdf5.h
和 H5public.h
不再对 OpenCV 可见,因为它们位于主 anaconda3/include/ 目录中,不在子文件夹中。
解决方案是将所有 .h 文件从 include/
目录复制到 include/python3.5m
目录 (将两者的内容复制到另一个目录并设置因为路径也可以工作) 这样所有的 .h 文件都在编译器可见的同一文件夹中。 OpenCV 现已构建!
通过在配置 cmake
之前设置CPLUS_INCLUDE_PATH
变量解决
export CPLUS_INCLUDE_PATH=$(python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())")
然后配置cmake为
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D INSTALL_C_EXAMPLES=OFF \
-D WITH_TBB=ON \
-D WITH_CUDA=ON \
-D BUILD_opencv_cudacodec=OFF \
-D ENABLE_FAST_MATH=1 \
-D CUDA_FAST_MATH=1 \
-D WITH_CUBLAS=1 \
-D WITH_V4L=ON \
-D WITH_QT=OFF \
-D WITH_OPENGL=ON \
-D WITH_GSTREAMER=ON \
-D OPENCV_GENERATE_PKGCONFIG=ON \
-D OPENCV_PC_FILE_NAME=opencv.pc \
-D OPENCV_ENABLE_NONFREE=ON \
-D OPENCV_EXTRA_MODULES_PATH=/home/udara/Documents/research/opencv/opencv-contrib-source/modules \
-D BUILD_EXAMPLES=ON \
-D HAVE_opencv_python3=ON \
-D OPENCV_PYTHON3_INSTALL_PATH=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") \
-D PYTHON3_PACKAGES_PATH=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") \
-D PYTHON_EXECUTABLE=$(which python) \
-D PYTHON_INCLUDE_DIR=$(python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \
-D PYTHON_LIBRARY=/home/udara/anaconda3/envs/jupyter/lib/libpython3.so ../opencv-source
文件夹结构
├── build
├── opencv-contrib-source
└── opencv-source