Z
Z
zeng1242021-10-29 21:35:26
PyQt
zeng124, 2021-10-29 21:35:26

Qt.qpa.plugin: Could not find the Qt platform plugin "windows" in "" This application failed to start because no Qt platform plugin could be initiali?

Started learning PyQT5 and ran into this problem 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 write the code myself in visual studio 2019
And I tried the method from https://qna.habr.com/q/920179 of this question, I don’t have this folder (C:\Users\Andrey\AppData\Local\Programs\Python\Python38 \lib\site-packages\PyQt5)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Amridin Nazarov, 2021-11-06
@Amletic_CoT

If moving the platforms folder doesn't work, then I think the problem is that the computer needs an environment variable.
You can add an environment variable if - hold down win + R , and in the window that opens, enter - sysdm.cpl
After, go to the Advanced tab, and click on Environment Variables from the bottom .
Next, create a new variable and give it a name - QT_QPA_PLATFORM_PLUGIN_PATH, and a path -
C:\Users\Username\AppData\Local\Programs\Python\Python39 (or your version of Python)\Lib\site-packages\PyQt5\Qt\plugins \platforms.
PS If the path cannot be entered normally, then just find the platforms folder yourself, copy the path, and paste this copied path into the desired input box.
If that doesn't work, then I don't know what's next. Hope it helped!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question