Could not build wheels for opencv-python-headless which use PEP 517 and cannot be installed directly

1. case重现

笔者是python环境下安装albumentations出现的,该库经常用于图像增强,在cv领域有很大的知名度。在使用下边的命令进行安装后

pip install albumentations

就报了ERROR:Could not build wheels for opencv-python-headless which use PEP 517 and cannot be installed directly

2. 原因及解决方案

albumentations库依赖opencv,在直接使用pip命令安装时,albumentations会默认采用opencv-python-headless作为opencv的默认依赖进行安装,由于opencv系列有多个版本,所以我们可以选择绕开,将albumentations依赖的opencv指向已经安装好的opencv-python库。输入下面命令即可:

pip install albumentations --no-binary qudida,albumentations

你可能感兴趣的:(TroubleShooting,opencv,python,计算机视觉)