exe does not find dlls using pyinstaller with pyqt

为君一笑 提交于 2019-12-24 06:33:41

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!