2

I am using anaconda 3 and when I turn python scripts to .exe using pyinstaller they failed to open and I got an error message that said,

Application can't start because could not find or load Qt platform plugin "windows" in " "

I looked on stack overflow and found a solution for it here, and it solved my problem. However, now when I download other programs from the internet and try to open them they display the same error,

Application can't start because could not find or load Qt platform plugin "windows" in " "

I have delete the QT_PLUGIN_PATH from the environment variables in order to make the program that I installed work, but when I do that my .exe fails to open and I have to add the QT_PLUGIN_PATH again to make the .exe work.

Is there a way to make both my .exe and installed programs work without having to add and delete the QT_PLUGIN_PATH from the environment variables every time?

In environment variables I have,

QT_PLUGIN_PATH="C:\Users\username\AppData\Local\Continuum\anaconda3\Library\plugins"

prexos
  • 153
  • 2
  • 2
  • 15
  • You could also create a batch file to start and have: QT_PLUGIN_PATH="C:\Users\username\AppData\Local\Continuum\anaconda3\Library\plugins" yourapp.exe That is, just separated by space. It works but is probably not convenient – IceFire Jul 08 '22 at 15:43

1 Answers1

3

I found a solution to my problem. I found that deleting the QT_PLUGIN_PATH from the environment variables and adding the platforms folder in my .exe folder fixes the problem. In my case, I am using anaconda 3, so I deleted QT_PLUGIN_PATH from the environment variables and then I copied the platforms folder from this directory, C:\Users\username\AppData\Local\Continuum\anaconda3\Library\plugins\platforms and pasted it to the same folder where my .exe is, which is in my desktop. Doing this fixed all my issues. I hope my solution helps you.

prexos
  • 153
  • 2
  • 2
  • 15