OS:ubuntu我可以从命令行安装opencv-python。但是,当我尝试安装带有opencv-python依赖项的自建包时,biuld失败:
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。
但仍然失败,并出现相同的错误。我
发布于 2020-08-25 14:45:07
您缺少依赖项。请查看上面提供的错误消息的这一部分:
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安装构建包所需的构建工具。
发布于 2021-01-07 18:42:13
在安装opencv-python之前运行pip3 install -U pip。
发布于 2020-08-29 10:56:51
最后弄清楚,当我在本地安装时,我对4.1.x版有一个要求,没有问题。当我安装依赖项时,它获取了最新的4.4版本,问题是1) pip版本是19.1 and2)从4.3 and2开始,轮子已经被更换了。
https://stackoverflow.com/questions/63567453
复制相似问题