安装opencv-python踩的坑

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

使用pip安装卡半天之后报了这个错误

为此找到这篇文章

Package | 解决 Could not build wheels for opencv-python which use PEP 517 and cannot be installed_1LOVESJohnny的博客-CSDN博客_could not build wheels for opencv-python which use背景在nvidia ngc平台下载docker image,根据实验要求在环境里安装opencv。因为当前实验tensorflow要求版本较低,我下载了比较久远的版本镜像。如果大家是自己复现代码,还是使用尽可能新的环境,则可以避免大部分环境问题。问题通过pip安装opencv,指令如下:pip install opencv-python安装过程的输出:Collecting opencv-python Downloading https://files.pythonhosted.org/pahttps://blog.csdn.net/iLOVEJohnny/article/details/121031935?ops_request_misc=&request_id=&biz_id=102&utm_term=ERROR:%20Could%20not%20build%20wheels%20&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduweb~default-1-121031935.142^v70^control,201^v4^add_ask&spm=1018.2226.3001.4187

然而按照这个操作之后,我pip更不能用了,似乎是把什么东西给删掉了

后来只能把pip卸载之后重新安装

然后改成conda安装opencv-python,出现这个报错

2.PackagesNotFoundError: The following packages are not available from current channels:

为此,找到这一篇文章https://huaweicloud.csdn.net/638069dcdacf622b8df87426.html?spm=1001.2101.3001.6650.4&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Eactivity-4-124564044-blog-125348413.pc_relevant_multi_platform_whitelistv3&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Eactivity-4-124564044-blog-125348413.pc_relevant_multi_platform_whitelistv3qicon-default.png?t=MBR7https://huaweicloud.csdn.net/638069dcdacf622b8df87426.html?spm=1001.2101.3001.6650.4&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Eactivity-4-124564044-blog-125348413.pc_relevant_multi_platform_whitelistv3&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Eactivity-4-124564044-blog-125348413.pc_relevant_multi_platform_whitelistv3确实成功安装,然而我在使用pip list查看安装的包的时候,出现了这个报错

3.ImportError: cannot import name 'SCHEME_KEYS'

为此找到这篇文章

关于安装opencv的一个问题:ImportError: cannot import name ‘SCHEME_KEYS‘,安装以前版本的opencv_爱学习的海鸥的博客-CSDN博客_scheme_keysImportError: cannot import name ‘SCHEME_KEYS‘https://blog.csdn.net/qq_56930981/article/details/123976887但是我没有卸载pip,而是把之前安装的py-opencv卸载掉了,pip list可以正常使用,然后按照作者所说,使用pip install opencv-python==3.4.2.17。目前opencv可以正常导入,pip也可以正常使用

你可能感兴趣的:(python,开发语言,opencv,计算机视觉)