首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法使用python 3.8构建opencv-python

无法使用python 3.8构建opencv-python
EN

Stack Overflow用户
提问于 2020-08-25 03:20:56
回答 3查看 1.7K关注 0票数 1

OS:ubuntu我可以从命令行安装opencv-python。但是,当我尝试安装带有opencv-python依赖项的自建包时,biuld失败:

代码语言:javascript
复制
Building wheels for collected packages: opencv-python
  Building wheel for opencv-python (PEP 517): started
  Building wheel for opencv-python (PEP 517): finished with status 'error'
  ERROR: Complete output from command /usr/local/bin/python /usr/local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmp7jntqv2r:
  ERROR: Not searching for unused variables given on the command line.
  CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
  -- Configuring incomplete, errors occurred!
  See also "/tmp/pip-install-utbicth7/opencv-python/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
  Not searching for unused variables given on the command line.
  CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
  -- Configuring incomplete, errors occurred!
  See also "/tmp/pip-install-utbicth7/opencv-python/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".


-- Trying "Unix Makefiles" generator - failure
  --------------------------------------------------------------------------------
  
  ********************************************************************************
  scikit-build could not get a working generator for your system. Aborting build.
  
  Building Linux wheels for Python 3.6 requires a compiler (e.g gcc).
  It can be installed using debian package manager:
  
    sudo apt-get install build-essential
  
  To build compliant wheels, consider using the manylinux system described in PEP-513.
  Get it with "dockcross/manylinux-x64" docker image:
  
    https://github.com/dockcross/dockcross#readme
  
  For more details, please refer to scikit-build documentation:
  
    http://scikit-build.readthedocs.io/en/latest/generators.html#linux
  
  ********************************************************************************
  ----------------------------------------
  ERROR: Failed building wheel for opencv-python

我怀疑问题出在scikit-build上。我确认我有忍者,让/gcc都有空。我手动设置了CMAKE_MAKE_PROGRAM=/usr/bin/make。

但仍然失败,并出现相同的错误。我

EN

回答 3

Stack Overflow用户

发布于 2020-08-25 14:45:07

您缺少依赖项。请查看上面提供的错误消息的这一部分:

代码语言:javascript
复制
  Building Linux wheels for Python 3.6 requires a compiler (e.g gcc).
  It can be installed using debian package manager:
  
    sudo apt-get install build-essential

因此,请使用apt-get安装构建包所需的构建工具。

票数 3
EN

Stack Overflow用户

发布于 2021-01-07 18:42:13

在安装opencv-python之前运行pip3 install -U pip

票数 1
EN

Stack Overflow用户

发布于 2020-08-29 10:56:51

最后弄清楚,当我在本地安装时,我对4.1.x版有一个要求,没有问题。当我安装依赖项时,它获取了最新的4.4版本,问题是1) pip版本是19.1 and2)从4.3 and2开始,轮子已经被更换了。

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

https://stackoverflow.com/questions/63567453

复制
相关文章

相似问题

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