qt.qpa.plugin: Could not find the Qt platform plugin "windows" in ""
-
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_())
-
@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.
-
@bkvldr
Set environment variableQT_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. -
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
-
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
-
@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.