【Mac Pycharm】无法使用opencv,qt.qpa.plugin: Could not find the Qt platform plugin "cocoa" in "

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.

导入最新的opencv-python运行一个小demo时,突然报错,导致摄像头无法打开。解决放法其实很简单:

pip3 install opencv-python-headless

或者

pip install opencv-python-headless

这里可能是新版的opencv默认没有把opencv-python-headless一起导入,需要在使用的时候用户自己选择导入。
在这里插入图片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章