无法使用python 3.8构建opencv python



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

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的构建上。我检查过我有忍者,让/gcc全部可用。我手动设置了CMAKE_MAKE_PROGRAM=/usr/bin/MAKE。

但还是失败了,出现了同样的错误。I

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

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安装构建包所需的构建工具。

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

最终发现,当我在本地安装时,我有一个版本4.1.x的要求,没有任何问题。当我使用依赖项进行安装时,它获得了最新的4.4版本,问题是1(pip版本是19.1,2(自4.3 opencv以来,轮子已经更换。

最新更新