pyqt5打包报错:qt.qpa.plugin: Could not load the Qt platform plugin “windows“
2026/7/29 14:47:22 网站建设 项目流程

笔者在将基于pyqt5库开发的界面打包为exe程序后,双击exe文件控制终端报错:

qt.qpa.plugin: Could not load the Qt platform plugin "windows" in "%QTDIR%\plugins\platforms\" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: direct2d, minimal, offscreen, windows, webgl.
原因:平台找不到插件,其实就是没找到qwindows.dll这个库文件

解决办法:手动把 qwindows.dll 复制到exe旁边,就可以运行了,此时插件就在当前目录。

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询