【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一起导入,需要在使用的时候用户自己选择导入。
【Mac Pycharm】无法使用opencv,qt.qpa.plugin: Could not find the Qt platform plugin

你可能感兴趣的:(Pycharm,Mac)