ERROR: Could not build wheels for opencv-python which use PEP 517 and cannot be installed d

第一种可能性当然是 更新setuptools

pip install --upgrade pip setuptools wheel

还有另一种可能性。

就是python和opencv版本不匹配

比如我问gpt:

python3.6 适配的opencv版本是什么

回答 :

Python3.6适配的opencv版本是opencv-python 4.5.4.60

pip install opencv-python==4.5.4.60

  • 10
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
The error message "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" usually means that there is a problem with the installation of the opencv-python package. One solution is to try installing the package using conda instead of pip. You can create a new conda environment and install opencv-python in that environment using the following commands: ``` conda create --name myenv conda activate myenv conda install -c conda-forge opencv ``` This will create a new environment called "myenv" and activate it, and then install opencv-python in that environment. If you still want to use pip to install opencv-python, you can try upgrading pip to the latest version using the following command: ``` python -m pip install --upgrade pip ``` Then, you can try installing opencv-python again using pip: ``` pip install opencv-python ``` If this still doesn't work, you can try installing the dependencies for opencv-python manually before installing opencv-python itself. The dependencies are numpy and setuptools. You can install them using the following commands: ``` pip install numpy pip install setuptools ``` Once you have installed these dependencies, you can try installing opencv-python again using pip: ``` pip install opencv-python ``` If none of these solutions work, you can try installing a pre-built binary package of opencv-python. You can download the package from the official opencv-python website and install it using pip: ``` pip install opencv_python‑4.2.0.32‑cp37‑cp37m‑win_amd64.whl ``` Replace the package name with the appropriate version and platform for your system.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值