Qt creator fails to open on Windows 10 "no Qt platform plugin could be initialized"

Viewed 43696

I had removed Qt from my Surface pro 4 and reinstall it since it seemed unable to find QtQuick controls and othe qml related modules. After performing the install procedure, I tried to open qt creator and I got this message

This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are: direct2d, minimal, offscreen, windows

6 Answers

Copy the folder plugins/platforms from your Qt build to the folder containing your executable. This should get it running.

Check whether you have an environment variable (system-wide or user-level) QT_PLUGIN_PATH defined. If so, try to remove it (or rename for later restoration). I had one Qt program installed which added this environment variable during its installation procedure and afterwards was unable to even start QtCreator or other self-built Qt5 programs even though the 'platforms' subdirectory was present and contained the required dlls. You may have to reboot for the change to take effect.

This is one of the methods to fix the issue:

  1. go to /pyQT5 -/QT /PLUGINS and then copy the "platforms"
    and then go back to
  2. /pyqt5_tools-/QT/BIN/ and then paste the folder.

It replaces the qwindows.dll file and it all works smooth.

Also if you don't find your designer file in qt_tools look into the bin directory or just search for it. I am using Python 3.8. and my python was installed in - C:\Users\divya\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\

METHOD 2: Go to (or wherever you have python installed) C:\Python38-32\Scripts and look for desginer. Click on it and voila you have a working desginer.

I got this exact error on linux.

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. 
Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.

Aborted (core dumped)

First, defining this environment variable before starting qtcreator causes more debug to be printed out:

export QT_DEBUG_PLUGINS=1

And then in the debug it said this when trying to start qtcreator from the commandline on ubuntu 18.04:

Cannot load library /home/myuser/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so: (libxkbcommon-x11.so.0: cannot open shared object file: No such file or directory)

Note that it cannot find libxkbcommon-x11, so the fix was this:

sudo apt-get install libxkbcommon-x11-dev
export PATH=$PATH:~/Qt/Tools/QtCreator/bin

Now qtcreator starts.

I am using Anaconda3. I solved it like that:

  1. go to C:\ProgramData\Anaconda3\Lib\site-packages\PyQt5\Qt5\plugins\platforms and then copy the "platforms" files (qminimal.dll, qoffscreen.dll, qwebgl.dll, qwindows.dll)

  2. go back to C:\ProgramData\Anaconda3 AND NOW... go to ...Anaconda3\Library\plugins\platforms

  3. paste the files here!

fantastically when i make the files hidden this error comes:(this application fails to start because no qt platform plugin could be initialized reinstalling application may fix the problem)but when i make them out from hidden mode everything works fine

Related