首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >(码头)安装opencv-python时出现“cmake失败的建筑轮”错误

(码头)安装opencv-python时出现“cmake失败的建筑轮”错误
EN

Stack Overflow用户
提问于 2022-09-20 22:28:19
回答 1查看 167关注 0票数 0

下面是一个演示问题的Dockerfile:

代码语言:javascript
复制
FROM php:7.1

RUN apt-get update
RUN apt-get install -y python3-pip
RUN pip3 install opencv-python

如果我做FROM php:8.0,但不做FROM php:7.1,它可以正常工作。我得到的错误如下:

代码语言:javascript
复制
    Running setup.py bdist_wheel for cmake: finished with status 'error'
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-f4o4i380/cmake/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-hc4d6dtu --python-tag cp37:
    Traceback (most recent call last):
      File "/tmp/pip-build-env-qno2yg1l/lib/python3.7/site-packages/skbuild/setuptools_wrap.py", line 613, in setup
        cmkr = cmaker.CMaker(cmake_executable)
      File "/tmp/pip-build-env-qno2yg1l/lib/python3.7/site-packages/skbuild/cmaker.py", line 141, in __init__
        self.cmake_version = get_cmake_version(self.cmake_executable)
      File "/tmp/pip-build-env-qno2yg1l/lib/python3.7/site-packages/skbuild/cmaker.py", line 96, in get_cmake_version
        "Problem with the CMake installation, aborting build. CMake executable is %s" % cmake_executable


        =============================DEBUG ASSISTANCE=============================
        If you are seeing a compilation error please try the following steps to
        successfully install cmake:
        1) Upgrade to the latest pip and try again. This will fix errors for most
           users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
        2) If on Linux, with glibc < 2.12, you can set PIP_ONLY_BINARY=cmake in
           order to retrieve the last manylinux1 compatible wheel.
        3) If on Linux, with glibc < 2.12, you can cap "cmake<3.23" in your
           requirements in order to retrieve the last manylinux1 compatible wheel.
        4) Open an issue with the debug information that follows at
           https://github.com/scikit-build/cmake-python-distributions/issues

        Python: 3.7.3
        platform: Linux-4.19.128-microsoft-standard-x86_64-with-debian-10.2
        glibc: glibc 2.28
        machine: x86_64
        bits: 64
        pip: 18.1
        setuptools: 65.3.0
        scikit-build: 0.15.0
        =============================DEBUG ASSISTANCE=============================

    Problem with the CMake installation, aborting build. CMake executable is cmake

    ----------------------------------------
    Failed building wheel for cmake
    Running setup.py clean for cmake
  Failed to build cmake
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-10-24 15:36:23

我把这个搞定了。我需要将RUN pip3 install --upgrade pip setuptools wheel添加到RUN apt-get install -y python3-pip之后的Dockerfile中。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73793245

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档