Skip to content
Advertisement

This application failed to start because no Qt platform plugin could be initialized

I am stuck trying to run a very simple Python script, getting this error:

JavaScript

The script code is:

JavaScript

However this Notebook code works in JupyterLab:

JavaScript

I am on macOS, using Anaconda and JupyterLab. I would appreciate any help with this issue. Thanks!

Advertisement

Answer

For me, it worked by using a opencv-python version prior to 4.2 version that just got released. The new version (4.2.0.32) released on Feb 2, 2020 seems to have caused this breaking change and probably expects to find Qt at a specific location (Users/ directory) as pointed by other answers.

You can try either manually installed from qt.io as suggested and making sure you get a .qt directory under yours Users directory, or you can use version 4.1.2.30, which works like charm without doing anything else.

It works for opencv-contrib-python too.

Advertisement