MAC下使用OPENCV与PYQT发生冲突 You might be loading **two sets of Qt binaries** into the same process

111 篇文章 3 订阅
11 篇文章 1 订阅

参考:https://www.pythonheidong.com/blog/article/410902/33fdf4203f66748d954f/

本文出现的问题应该是在Mac上才会出现

You might be loading **two sets of Qt binaries** into the same process. Check that all plugins are compiled against the right Qt binaries. Export DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries are being loaded.
qt.qpa.plugin: Could not load the Qt platform plugin "cocoa" in "**/anaconda3/envs/face/lib/python3.7/site-packages/cv2/qt/plugins**" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: cocoa, minimal, offscreen, webgl.

解决方法
出现问题的原因在于mac版本下安装的opencv包含有一些qt的头文件与pyqt中的发生了冲突,导致无法正确导入相应的包,需要将其更换

按照以下步骤进行
1.删除原有的opencv,删除过程中出现y/n选择y即可

pip uninstall opencv-python

2.安装opencv–headless版本

pip install opencv-contrib-python-headless

至此应该就可以同时正常运行cv2和pyqt了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值