", line 1, in ImportError: No module named numpy.distutils解决方法:sudo apt-get install python-numpy错误2:- Checking for module 'gstreamer-._ubuntu18.04 libdc1394-2">
当前位置:   article > 正文

ubuntu18.04下opencv3.4.5 opencv_contribution (GPU加速)安装记录_ubuntu18.04 libdc1394-2

ubuntu18.04 libdc1394-2

ubuntu18.04 opencv3.4.8 1080Ti

依赖项:

  1. sudo apt-get install build-essential
  2. sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
  3. sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev

cmake \
    -D CMAKE_BUILD_TYPE=RELEASE \
    -D CMAKE_INSTALL_PREFIX=/usr/local \
    -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib-3.4.8/modules/ \
    -D CUDA_CUDA_LIBRARY=/usr/local/cuda/lib64/stubs/libcuda.so \
    -D CUDA_ARCH_BIN=7.5 \
    -D CUDA_ARCH_PTX="" \
    -D WITH_CUDA=ON \
    -D WITH_TBB=ON \
    -D BUILD_NEW_PYTHON_SUPPORT=ON \
    -D WITH_V4L=ON \
    -D INSTALL_C_EXAMPLES=ON \
    -D INSTALL_PYTHON_EXAMPLES=ON \
    -D BUILD_EXAMPLES=ON \
    -D WITH_QT=ON \
    -D WITH_OPENGL=ON \
    -D ENABLE_FAST_MATH=1 \
    -D CUDA_FAST_MATH=1 \
    -D WITH_CUBLAS=1 \
    -D WITH_NVCUVID=ON \
    -D BUILD_opencv_cudacodec=OFF ..

 

错误1:No module named numpy.distutils

  1. Traceback (most recent call last):
  2. File "<string>", line 1, in <module>
  3. ImportError: No module named numpy.distutils

解决方法:

sudo apt-get install python-numpy

 

错误2:

  1. - Checking for module 'gstreamer-base-1.0'
  2. -- No package 'gstreamer-base-1.0' found
  3. -- Checking for module 'gstreamer-video-1.0'
  4. -- No package 'gstreamer-video-1.0' found
  5. -- Checking for module 'gstreamer-app-1.0'
  6. -- No package 'gstreamer-app-1.0' found
  7. -- Checking for module 'gstreamer-riff-1.0'
  8. -- No package 'gstreamer-riff-1.0' found
  9. -- Checking for module 'gstreamer-pbutils-1.0'
  10. -- No package 'gstreamer-pbutils-1.0' found
  11. -- Checking for module 'gstreamer-base-0.10'
  12. -- No package 'gstreamer-base-0.10' found
  13. -- Checking for module 'gstreamer-video-0.10'
  14. -- No package 'gstreamer-video-0.10' found
  15. -- Checking for module 'gstreamer-app-0.10'
  16. -- No package 'gstreamer-app-0.10' found
  17. -- Checking for module 'gstreamer-riff-0.10'
  18. -- No package 'gstreamer-riff-0.10' found
  19. -- Checking for module 'gstreamer-pbutils-0.10'
  20. -- No package 'gstreamer-pbutils-0.10' found

解决方法:

sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev

 

错误3:

  1. -- Checking for module 'libdc1394-2'
  2. -- No package 'libdc1394-2' found
  3. -- Checking for module 'libdc1394'
  4. -- No package 'libdc1394' found

解决方法:

sudo apt-get install libdc1394-22-dev

 

错误4:

-- Could NOT find Atlas (missing: Atlas_CLAPACK_INCLUDE_DIR Atlas_CBLAS_LIBRARY Atlas_BLAS_LIBRARY)

解决方法:

sudo apt-get install libatlas-base-dev

 

错误5:

  1. Could not find OpenBLAS include. Turning OpenBLAS_FOUND off
  2. Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off

解决方法:

  1. sudo apt-get install libopenblas-dev
  2. sudo apt-get install liblapacke-dev

添加软链接:

sudo ln -s /usr/include/lapacke.h /usr/include/x86_64-linux-gnu

添加OpenBLAS库路径于 ~/opencv-x.x.x/cmake/OpenCVFindOpenBLAS.cmake文件:

46行SET(Open_BLAS_LIB_SEARCH_PATHS

        Open_BLAS_INCLUDE_SEARCH_PATHS path: /usr/include/x86_64-linux-gnu

58行SET(Open_BLAS_LIB_SEARCH_PATHS

          Open_BLAS_LIB_SEARCH_PATHS path: /usr/lib/x86_64-linux-gnu

 

错误6:

  1. The imported target "vtkRenderingPythonTkWidgets" references the file
  2. "/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so"
  3. but this file does not exist. Possible reasons include:
  4. * The file was deleted, renamed, or moved to another location.
  5. * An install or uninstall procedure did not complete successfully.
  6. * The installation package was faulty and contained
  7. "/usr/lib/cmake/vtk-6.3/VTKTargets.cmake"
  8. but not all the files it references.

解决方法:

sudo ln -s /usr/lib/python2.7/dist-packages/vtk/libvtkRenderingPythonTkWidgets.x86_64-linux-gnu.so /usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so

 

错误7:

  1. -- The imported target "vtk" references the file
  2. "/usr/bin/vtk"
  3. but this file does not exist. Possible reasons include:
  4. * The file was deleted, renamed, or moved to another location.
  5. * An install or uninstall procedure did not complete successfully.
  6. * The installation package was faulty and contained
  7. "/usr/lib/cmake/vtk-6.3/VTKTargets.cmake"
  8. but not all the files it references.

解决方法:

sudo ln -s /usr/bin/vtk6 /usr/bin/vtk 

 

错误8:

  1. CMake Error at cmake/OpenCVFindLibsGUI.cmake:18 (find_package):
  2. Could not find a package configuration file provided by "Qt5" with any of
  3. the following names:
  4. Qt5Config.cmake
  5. qt5-config.cmake
  6. Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR"
  7. to a directory containing one of the above files. If "Qt5" provides a
  8. separate development package or SDK, be sure it has been installed.

解决方法:

  1. sudo apt-get install qtbase5-dev
  2. sudo apt-get install qtdeclarative5-dev

 

错误9:

  1. -- Looking for linux/videodev.h
  2. -- Looking for linux/videodev.h - not found
  3. -- Looking for linux/videodev2.h
  4. -- Looking for linux/videodev2.h - found
  5. -- Looking for sys/videoio.h
  6. -- Looking for sys/videoio.h - not found

解决方法:

  1. sudo apt-get install libv4l-dev
  2. sudo ln -s /usr/include/libv4l1-videodev.h /usr/include/linux/videodev.h

 

错误10:

Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)

解决方法:

sudo apt-get install openjdk-8-jdk

 

错误11:

  1. Could NOT find Pylint (missing: PYLINT_EXECUTABLE)
  2. Could NOT find Flake8 (missing: FLAKE8_EXECUTABLE)

决方法:

  1. sudo apt-get install pylint
  2. sudo apt-get install flake8

 

错误12:

 Looking for ccache - not found

解决方法:

sudo apt-get install ccache

 

错误13:

  1. -- Checking for module 'tesseract'
  2. -- No package 'tesseract' found
  3. -- Tesseract: NO

解决方法:
 

sudo apt-get install tesseract-ocr

 

错误14:

Module opencv_sfm disabled because the following dependencies are not found: Eigen

解决方法:

sudo apt-get install libeigen3-dev

 

错误15:

  1. No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available.
  2. -- Failed to find installed gflags CMake configuration, searching for gflags build directories exported with CMake.
  3. -- Failed to find gflags - Failed to find an installed/exported CMake configuration for gflags, will perform search for installed gflags components.
  4. -- Failed to find gflags - Could not find gflags include directory, set GFLAGS_INCLUDE_DIR to directory containing gflags/gflags.h
  5. -- Failed to find glog - Could not find glog include directory, set GLOG_INCLUDE_DIR to directory containing glog/logging.h

解决方法:

sudo apt-get install libceres-dev

 

错误16:

  1. Checking for module 'libavresample'
  2. No package 'libavresample' found

解决方法:

sudo apt-get install libavresample-dev

 

错误17:

Could NOT find HDF5 (missing: HDF5_LIBRARIES HDF5_INCLUDE_DIRS) (found version "")

解决方法:

sudo apt install libhdf5-dev

 

错误18:

VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file

解决方法:

sudo apt install libvtk6-dev

 

 

 

 

 

 

 

 

 

 

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/119826?site
推荐阅读
相关标签