PyQt5:This application failed to start because it could not find or load the Qt platform plugin

文章目录

可以按照这个安装:【PyQt5笔记】使用 designer 开发 python GUI 界面

问题描述

安装完 PyQt5、pyqt5-tools 后,点击 designer.exe 报错:This application failed to start because it could not find or load the Qt platform plugin"
PyQt5:This application failed to start because it could not find or load the Qt platform plugin

解决方案

首先我们现在处于 pyqt5_tools > Qt > bin 目录下,点击这里的 designer.exe 会报错呢。
PyQt5:This application failed to start because it could not find or load the Qt platform plugin
那我们返回这个目录的上一级目录,也就是 pyqt5_tool > Qt,然后进入这个目录下的 plugins
PyQt5:This application failed to start because it could not find or load the Qt platform plugin
看到这个 platforms 了吗,复制这个文件夹
PyQt5:This application failed to start because it could not find or load the Qt platform plugin
回到 pyqt5_tools > Qt > plugins 目录,用刚刚复制的 platforms 覆盖这里的 platforms 即可。
PyQt5:This application failed to start because it could not find or load the Qt platform plugin
好,现在以及可以正常运行 designer.exe 了。
PyQt5:This application failed to start because it could not find or load the Qt platform plugin