赞
踩
在搭建环境,通过python安装opencv时,报错:
ERROR: Failed building wheel for opencv-python
Failed to build opencv-python
ERROR: Could not build wheels for opencv-python, which is required to install pyproject.toml-based projects
Please check the install target is valid and see CMake's output for more information.
----------------------------------------
ERROR: Failed building wheel for opencv-python
Failed to build opencv-python
ERROR: Could not build wheels for opencv-python, which is required to install pyproject.toml-based projects
截图如下:
主要报错信息内容翻译如下所示:
Please check the install target is valid and see CMake's output for more information.
----------------------------------------
ERROR: Failed building wheel for opencv-python
Failed to build opencv-python
ERROR: Could not build wheels for opencv-python, which is required to install pyproject.toml-based projects
翻译:
请检查安装目标是否有效,并查看 CMake 的输出以获取更多信息。
----------------------------------------
错误:opencv-python 的构建轮失败
无法构建 opencv-python
错误:无法为 opencv-python 构建轮子,这是安装基于 pyproject.toml 的项目所必需的
经过查阅资料,发现是版本兼容性问题。当使用pip install opencv-python命令安装的是最新版本,当前python版本不支持。需要安装当前版本python支持的opencv-python版本。
附:各版本Opencv的对应的各版本Python安装包:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv
小伙伴们按下面的解决方法即可解决!!!
要解决这个错误,需要安装当前版本python支持的opencv-python版本。如opencv-python==4.3.0.38。
命令如下:
pip install -i https://pypi.douban.com/simple/ pip install opencv-python==4.3.0.38
截图如下:
附:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。