Python openCV qt.qpa.plugin: could not find the qt platform plugin "cocoa" in "" 错误在MacOS上的解决方法

qt.qpa.plugin: Could not find the Qt platform plugin "cocoa" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
 

我在将自己的MacOS重新安装一下后,想测试一下Python的opencv能不能用
然后就 pip install opencv-python
果不其然,在我测试打开摄像头代码的时候报了一个
qt.qpa.plugin: could not find the qt platform plugin “cocoa” in “”

当时各种Goole,百度都用上了。
最后得到的解决方法是

pip install opencv-python-headless
1
就行了

==========

应该是版本的问题,最新版的opencv可能少了这个。
也可以安装其他老版的opencv来解决

pip install opencv-python==4.0.0.21   
 

发布了113 篇原创文章 · 获赞 11 · 访问量 11万+

猜你喜欢

转载自blog.csdn.net/testManger/article/details/105220171