【Python】安装albumentations时安装opencv-python-headless报错

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

pip install albumentations

就报了ERROR:Could not build wheels for opencv-python-headless which use PEP 517 and cannot be installed directly。
albumentations库依赖opencv,在直接使用pip命令安装时,albumentations会默认采用opencv-python-headless作为opencv的默认依赖进行安装,由于opencv系列有多个版本,所以我们可以选择绕开,将albumentations依赖的opencv指向已经安装好的opencv-python库。输入下面命令即可:

pip install albumentations --no-binary qudida,albumentations

猜你喜欢

转载自blog.csdn.net/lingchen1906/article/details/128738410