问题
When I use pyinstaller --windowed main.py on my program I get the following error when I run the resulting executable main.exe:
This application failed to start because it could not find or load the Qt platform plugin "windows" in "".
Reinstalling the application may fix the problem.
The folder structure looks like this:
main
├── PyQt5
| └── Qt
| └── plugins
| ├── iconengines
| ├── imageformats
| ├── platforms
| └── printsupport
├── main.exe
└── ...
The error disappears when I change it to:
main
├── iconengines
├── imageformats
├── platforms
├── printsupport
├── main.exe
└── ...
I suspect the program does not look for dlls deep enough.
However I would like to run pyinstaller --windowed --onefile main.py.
Of course when I do this I cannot change the folder structure.
How can I get the program to run using the --onefile flag?
来源:https://stackoverflow.com/questions/47532133/exe-does-not-find-dlls-using-pyinstaller-with-pyqt