How to fix qt.qpa.plugin: Could not find the Qt platform plugin "windows" in "" error
-
wrote on 25 Feb 2022, 22:38 last edited by
Whenever i try to run a file that uses pyqt5, i get this message and the code wont work:
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.
I uninstalled python, installed older versions etc. nothing worked. When i tried to run the same code on a friend's pc though, it ran without a problem. Could anyone help me fix this problem? (By the way i don't use virtual environments so any solutions that include it probably won't work for me)(I'm currently using vs code,my pc has win10 , i'm using python 3.10.2) -
Hi and welcome to devnet,
You should try starting your script with the QT_DEBUG_PLUGINS environment variable set to 1 to get more information about what happens with the plugins.
-
Hi and welcome to devnet,
You should try starting your script with the QT_DEBUG_PLUGINS environment variable set to 1 to get more information about what happens with the plugins.
-
I did not write about "virtual environments" but about "environment variable".
-
wrote on 1 Mar 2022, 16:15 last edited by
@SGaist I did what you said and got this message
QFactoryLoader::QFactoryLoader() checking directory path "C:/Users/GOKTUº ALKAN/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. -
Hi,
You should have had way more messages than that. There should be a full plugin dump.
-
@SGaist Thats all i got. Maybe i'm doing something wrong? i used this: os.environ["QT_DEBUG_PLUGINS"] = "1"
@Gokalp said in How to fix qt.qpa.plugin: Could not find the Qt platform plugin "windows" in "" error:
i used this: os.environ["QT_DEBUG_PLUGINS"] = "1"
This is not going to work this way.
Set it in a terminal and then start your app in this terminal. -
@Gokalp said in How to fix qt.qpa.plugin: Could not find the Qt platform plugin "windows" in "" error:
i used this: os.environ["QT_DEBUG_PLUGINS"] = "1"
This is not going to work this way.
Set it in a terminal and then start your app in this terminal.wrote on 4 Mar 2022, 11:48 last edited by@jsulm said in How to fix qt.qpa.plugin: Could not find the Qt platform plugin "windows" in "" error:
os.environ["QT_DEBUG_PLUGINS"] = "1"
How can i set it in the terminal?
-
@jsulm said in How to fix qt.qpa.plugin: Could not find the Qt platform plugin "windows" in "" error:
os.environ["QT_DEBUG_PLUGINS"] = "1"
How can i set it in the terminal?
@Gokalp On Windows:
set QT_DEBUG_PLUGINS=1
-
Can you retry with an environment stored in a path without space or accented character ?
-
wrote on 4 Mar 2022, 13:25 last edited by
@SGaist How can i do that? My brother happened to be at home when this pc arrived so he made the username his name which contains Ö and Ğ characters... I tried to change the username several times but it never changed on the terminal so i really don't know what to do. Maybe there is another way that i can do what you're saying?
-
Install your python environment in a folder starting from the root of your disk. For example "C:/Code/name_of_your_environment".
-
Install your python environment in a folder starting from the root of your disk. For example "C:/Code/name_of_your_environment".
-
How did you install Python ?
How are you managing your virtual environments ? -
Then I would recommend reconsidering that modus operandi.
-
@SGaist I have never messed with environments, i installed python from its site and used it globally. All of my modues are also installed globally.
@Gokalp said in How to fix qt.qpa.plugin: Could not find the Qt platform plugin "windows" in "" error:
i installed python from its site
Which site?
Using Python installer from official Python website allows you to select the installation folder. -
@Gokalp said in How to fix qt.qpa.plugin: Could not find the Qt platform plugin "windows" in "" error:
i installed python from its site
Which site?
Using Python installer from official Python website allows you to select the installation folder.
1/29