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 ""

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

Scheduled Pinned Locked Moved Solved Qt for Python
5 Posts 3 Posters 5.9k Views
  • 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.
  • B Offline
    B Offline
    bkvldr
    wrote on 13 Apr 2022, 17:06 last edited by
    #1

    Hi All
    The small program below fails with the message shown in thread subject.
    The same happens when I import from PySide6, but I have no error when I import from PyQt5.
    I have installed Qt5 and Qt6 pluss PyQy5, PyQt6 and PySide6.

    I am in the QTCreator 7.0.0 Community on Win10.

    I already have an application running with Qt5, and I thought I'd create the next version with Qt6, but then I have this error when tryein to use qt6.
    Help will be appreciated

    # This Python file uses the following encoding: utf-8
    import sys
    from PyQt6.QtWidgets import QApplication, QWidget
    
    
    class Widget(QWidget):
        def __init__(self):
            QWidget.__init__(self)
    
    
    if __name__ == "__main__":
        app = QApplication([])
        window = Widget()
        window.show()
        sys.exit(app.exec_())
    
    J 1 Reply Last reply 13 Apr 2022, 17:32
    0
    • H hskoglund
      13 Apr 2022, 20:33

      Hi, try installing again, but this time at C:\ root (i.e. not somewhere in your Users folder)

      Also, see for example https://forum.qt.io/topic/134667/how-to-fix-qt-qpa-plugin-could-not-find-the-qt-platform-plugin-windows-in-error

      B Offline
      B Offline
      bkvldr
      wrote on 14 Apr 2022, 09:20 last edited by bkvldr
      #5

      @hskoglund
      Thanks.
      I reinstalled Python in C:\Python. I had to edit the PATH systemvariable so that python.exe could be found, and I went to Options in QTCreator to point to the new Python location.(I guess reinstalling QTCreator would have fixed it, too). I installed PySide6, PyQt6 and PyQt5 again using pip.

      The little program I posted now runs with PyQ5, PyQt6 and PySide6

      My user name has a "special" character, like the other guy in the thread you linked to. Maybe that is why I should not install python in my user directory.

      1 Reply Last reply
      2
      • B bkvldr
        13 Apr 2022, 17:06

        Hi All
        The small program below fails with the message shown in thread subject.
        The same happens when I import from PySide6, but I have no error when I import from PyQt5.
        I have installed Qt5 and Qt6 pluss PyQy5, PyQt6 and PySide6.

        I am in the QTCreator 7.0.0 Community on Win10.

        I already have an application running with Qt5, and I thought I'd create the next version with Qt6, but then I have this error when tryein to use qt6.
        Help will be appreciated

        # This Python file uses the following encoding: utf-8
        import sys
        from PyQt6.QtWidgets import QApplication, QWidget
        
        
        class Widget(QWidget):
            def __init__(self):
                QWidget.__init__(self)
        
        
        if __name__ == "__main__":
            app = QApplication([])
            window = Widget()
            window.show()
            sys.exit(app.exec_())
        
        J Offline
        J Offline
        JonB
        wrote on 13 Apr 2022, 17:32 last edited by
        #2

        @bkvldr
        Set environment variable QT_DEBUG_PLUGINS=1 from the command-line you run the script from; you can set it in Run Environment if you run from Creator. Look at the diagnostic output, at the end, for more information on what is causing the issue.

        1 Reply Last reply
        1
        • B Offline
          B Offline
          bkvldr
          wrote on 13 Apr 2022, 20:20 last edited by bkvldr
          #3

          Thanks.
          I did not get much more, but it points to that directory in bold characters below.
          I don't find the last subdirectrory "platform" on my computer.

          C:\Users\xxxxxxx\Ladelogg2\Ladelogg2>SET QT_DEBUG_PLUGINS=1

          C:\Users\xxxxxxx\Ladelogg2\Ladelogg2>python widget.py
          qt.core.plugin.factoryloader: checking directory path "C:/Users/xxxxxxx/AppData/Local/Programs/Python/Python310/platforms" ...
          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.

          C:\Users\xxxxxxx\Ladelogg2\Ladelogg2>

          It sugggests a reinstall, but I have installed again, and it did not help

          1 Reply Last reply
          0
          • H Offline
            H Offline
            hskoglund
            wrote on 13 Apr 2022, 20:33 last edited by
            #4

            Hi, try installing again, but this time at C:\ root (i.e. not somewhere in your Users folder)

            Also, see for example https://forum.qt.io/topic/134667/how-to-fix-qt-qpa-plugin-could-not-find-the-qt-platform-plugin-windows-in-error

            B 1 Reply Last reply 14 Apr 2022, 09:20
            2
            • H hskoglund
              13 Apr 2022, 20:33

              Hi, try installing again, but this time at C:\ root (i.e. not somewhere in your Users folder)

              Also, see for example https://forum.qt.io/topic/134667/how-to-fix-qt-qpa-plugin-could-not-find-the-qt-platform-plugin-windows-in-error

              B Offline
              B Offline
              bkvldr
              wrote on 14 Apr 2022, 09:20 last edited by bkvldr
              #5

              @hskoglund
              Thanks.
              I reinstalled Python in C:\Python. I had to edit the PATH systemvariable so that python.exe could be found, and I went to Options in QTCreator to point to the new Python location.(I guess reinstalling QTCreator would have fixed it, too). I installed PySide6, PyQt6 and PyQt5 again using pip.

              The little program I posted now runs with PyQ5, PyQt6 and PySide6

              My user name has a "special" character, like the other guy in the thread you linked to. Maybe that is why I should not install python in my user directory.

              1 Reply Last reply
              2

              3/5

              13 Apr 2022, 20:20

              • Login

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