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一起導入,需要在使用的時候用戶自己選擇導入。