0

I'm running a python function in Matlab and when I run I got the error:

This application failed to start because it could not find or load the Qt plataform plugin 'windows' in '' '' , Available plugins are: minimal offscreen, windows. Reinstalling the application may fix this problem.

I already followed the steps in this video copying the platform folder to pyqt tools and in this post add to the environment path. If I run my code in python it works fine, It seems that Matlab is not finding the Qt platform plugin 'Windows' Someone can help me, please?

Jeniffer Barreto
  • 373
  • 2
  • 10

2 Answers2

0

This is the problem of deploying Qt applications. Depending on platform you're using you can find tool for deploying, it is in Qt directory. For example, on my PC with Windows this is:

c:\Qt\5.15.0\mingw81_64\bin\windeployqt.exe

You can call this tool like this:

windeployqt <path-to-app-binary>
//  OR
windeployqt --qmldir  <path-to-app-qml-files>  <path-to-app-binary>

There are many other options like --debug, --release, etc. Too see all of them, just call windeployqt.

On other platforms it could be linuxdeployqt, macdeployqt, also pyqtdeploy.

After calling this tool it will copy all required submodules to (near) your app, so it will find all it needs.

Ihor Drachuk
  • 1,192
  • 6
  • 16
0

On my Windows system, I had the same experience that the Python function ran natively, but would not run via MATLAB. The problem was missing or incompatible dlls (not exe) files. To solve the problem I copied the exact dlls from my conda environment into the MATLAB \bin\win64 folder. That is, I copied these five dlls

  • qdirect2d.dll
  • qminimal.dll
  • qoffscreen.dll
  • qwebgl.dll
  • qwindows.dll

from the \Library\plugins\platforms folder of my conda environment

C:\Users\username\AppData\Local\Continuum\envs\myenv\Library\plugins\platforms

into the MATLAB folder

C:\Program Files\MATLAB\R2020b\bin\win64\platforms

While doing the copy, I overwrote three dlls which already existed in the MATLAB folder.

Eric
  • 1
  • 1