首页 > 解决方案 > 诗歌安装 opencv-contrib-python 失败

问题描述

我正在使用诗歌来安装依赖项以及在我的 Windows pc 和树莓派上运行的项目。

我在两台机器上都使用 python 3.9.6 和诗歌 1.1.8。

诗歌安装作品只能在电脑上找到。

在 pi 上安装诗歌失败,出现以下错误:

软件包操作:1 次安装、0 次更新、0 次删除

  • Installing opencv-contrib-python (4.5.3.56): Failed

  EnvCommandError

  Command ['/home/pi/.cache/pypoetry/virtualenvs/headset-v3RTQD8O-py3.9/bin/pip', 'install', '--no-deps', 'file:///home/pi/.cache/pypoetry/artifacts/7e/28/b6/71f401b246599f739692821b247f4fd4e36074b02a183e5832adb33a9a/opencv-contrib-python-4.5.3.56.tar.gz'] errored with the following return code 1, and output: 
  Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
  Processing /home/pi/.cache/pypoetry/artifacts/7e/28/b6/71f401b246599f739692821b247f4fd4e36074b02a183e5832adb33a9a/opencv-contrib-python-4.5.3.56.tar.gz
    Installing build dependencies: started
    Installing build dependencies: still running...
    Installing build dependencies: finished with status 'done'
    Getting requirements to build wheel: started
    Getting requirements to build wheel: finished with status 'done'
      Preparing wheel metadata: started
      Preparing wheel metadata: finished with status 'done'
  Building wheels for collected packages: opencv-contrib-python
    Building wheel for opencv-contrib-python (PEP 517): started
    Building wheel for opencv-contrib-python (PEP 517): finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /home/pi/.cache/pypoetry/virtualenvs/headset-v3RTQD8O-py3.9/bin/python /home/pi/.cache/pypoetry/virtualenvs/headset-v3RTQD8O-py3.9/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmp2928ygzi
         cwd: /tmp/pip-req-build-vtu3bx_r
    Complete output (11 lines):
    patching file opencv/3rdparty/openexr/IlmImf/ImfSystemSpecific.cpp
    /tmp/pip-build-env-gtb6_i8l/overlay/lib/python3.9/site-packages/cmake/data/bin/cmake: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /tmp/pip-build-env-gtb6_i8l/overlay/lib/python3.9/site-packages/cmake/data/bin/cmake)
      File "/tmp/pip-build-env-gtb6_i8l/overlay/lib/python3.9/site-packages/skbuild/setuptools_wrap.py", line 564, in setup
        cmkr = cmaker.CMaker(cmake_executable)
      File "/tmp/pip-build-env-gtb6_i8l/overlay/lib/python3.9/site-packages/skbuild/cmaker.py", line 95, in __init__
        self.cmake_version = get_cmake_version(self.cmake_executable)
      File "/tmp/pip-build-env-gtb6_i8l/overlay/lib/python3.9/site-packages/skbuild/cmaker.py", line 81, in get_cmake_version
        raise SKBuildError(
    Traceback (most recent call last):
    
    Problem with the CMake installation, aborting build. CMake executable is cmake
    ----------------------------------------
    ERROR: Failed building wheel for opencv-contrib-python
  Failed to build opencv-contrib-python
  ERROR: Could not build wheels for opencv-contrib-python which use PEP 517 and cannot be installed directly
  

  at ~/.poetry/lib/poetry/utils/env.py:1101 in _run
      1097│                 output = subprocess.check_output(
      1098│                     cmd, stderr=subprocess.STDOUT, **kwargs
      1099│                 )
      1100│         except CalledProcessError as e:
    → 1101│             raise EnvCommandError(e, input=input_)
      1102│ 
      1103│         return decode(output)
      1104│ 
      1105│     def execute(self, bin, *args, **kwargs):

我以前在 pi 上安装了 opencv4.4.0,但我通过回到 opencv 文件夹并运行来摆脱它,sudo make install然后sudo make uninstall 我不确定还有什么可能导致失败,有什么想法吗?

标签: pythonopencvopencv-pythonpython-poetry

解决方案


推荐阅读