【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一起導入,需要在使用的時候用戶自己選擇導入。
在這裏插入圖片描述

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