Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
8
Help us understand the problem. What is going on with this article?
@jmtsn

python-opencvでQt plugin "cocoa"が見つからないというエラー

More than 1 year has passed since last update.

結構悩んだので、忘備録

環境

Mac OS 10.15.3
Python 3.7.3 (by homebrew)
opencv-contrib-python 4.2.0.32 (by pip)
opencv-python 4.2.0.32 (by pip)

解決策

python-opencvを入れて貰い物のコードを試していたら、
下記のようなエラーが。

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.

調べると、環境変数QT_QPA_PLATFORM_PLUGIN_PATHなるものを設定しろ、という人が多かったが、自前の環境ではうまくいかず。

結局、opencv-python 4.1系にダウングレードしたら解決した。

pip3 install opencv-python==4.1.2.30
pip3 install opencv-contrib-python==4.1.2.30

参考

8
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
jmtsn
非情報系。お酒は泡盛派。

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
8
Help us understand the problem. What is going on with this article?