Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. qt.qpa.plugin: Could not find the Qt platform plugin "windows" in ""
Forum Updated to NodeBB v4.3 + New Features

qt.qpa.plugin: Could not find the Qt platform plugin "windows" in ""

Scheduled Pinned Locked Moved Solved Qt for Python
5 Posts 4 Posters 4.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Galax
    wrote on last edited by
    #1

    Hi. So I compiled a simple PySide6 UI Python file using pyinstaller. When I run the exe, it gave me this error:

    qt.qpa.plugin: Could not find the Qt platform plugin "windows" in ""
    This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
    

    But when I run my source code file, my UI works just fine. Any help would be appreciated.

    JonBJ 1 Reply Last reply
    0
    • G Galax

      Hi. So I compiled a simple PySide6 UI Python file using pyinstaller. When I run the exe, it gave me this error:

      qt.qpa.plugin: Could not find the Qt platform plugin "windows" in ""
      This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
      

      But when I run my source code file, my UI works just fine. Any help would be appreciated.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @Galax
      Set environment variable QT_DEBUG_PLUGINS=1, run your application, and look at the end of the diagnostic output for the reason.

      D 1 Reply Last reply
      2
      • G Offline
        G Offline
        Galax
        wrote on last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • JonBJ JonB

          @Galax
          Set environment variable QT_DEBUG_PLUGINS=1, run your application, and look at the end of the diagnostic output for the reason.

          D Offline
          D Offline
          Dariusz
          wrote on last edited by
          #4

          @JonB said in qt.qpa.plugin: Could not find the Qt platform plugin "windows" in "":

          QT_DEBUG_PLUGINS

          I'm having the same problem, @Galax How did you fix the issue? I added the qt debug to my env path
          env = os.environ env.setdefault("QT_DEBUG_PLUGINS","1")
          And run >
          sub = Popen(["pyinstaller", appName + ".spec"], env=env)
          I've got some warning like >

          97 WARNING: Several hooks defined for module 'win32ctypes.core'. Please take care they do not conflict.
          6693 WARNING: lib not found: shiboken6.abi3.dll dependency of s:\01_code\pyenv\lib\site-packages\PySide6\QtGui.pyd
          6716 WARNING: lib not found: shiboken6.abi3.dll dependency of s:\01_code\pyenv\lib\site-packages\PySide6\QtNetwork.pyd
          6740 WARNING: lib not found: shiboken6.abi3.dll dependency of s:\01_code\pyenv\lib\site-packages\PySide6\QtCore.pyd
          6763 WARNING: lib not found: shiboken6.abi3.dll dependency of s:\01_code\pyenv\lib\site-packages\PySide6\QtWidgets.pyd
          

          But dunno how to bite them. Any hints?

          1 Reply Last reply
          0
          • C Offline
            C Offline
            Caiorr
            wrote on last edited by
            #5

            I think the problem is PySide6 is not compatible yet with pyinstaller.

            https://doc.qt.io/qtforpython/deployment-pyinstaller.html

            "
            Status of Qt 6 Support¶

            As of March 2021, Qt 6 is not supported yet. PyInstaller is unable to properly deploy Qt; the Qt plugins are not copied. With that, using –onefile is not possible.

            It is possible to use PyInstaller for the non –onefile case though by manually copying the Qt plugins, QML imports and translations into the dist directory after running PyInstaller.

            On Windows, this can be achieved by running the windeployqt tool from the Qt SDK on the Qt libraries present in the dist directory, for example:

            windeployqt dist\app\Qt6Widgets.dll
            

            "

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved