PyQt5问题:could not find or load the Qt platform plugin "windows"

一、安装

  1. 终端安装: pip install pyqt5
    pip install pyqt5-tools
    (注意python版本)
  2. PyCharm安装:files->settings->Project Interpreter 右侧边栏点击+号,搜索安装pyqt5和pyqt5-tools。

二、调试
安装完成后, 运行窗体可能出现:could not find or load the Qt platform plugin "windows"的报错提示框:
解决方式: 环境变量配置:

  1. 首先找到你的QT安装路径,如果使用的是PyCharm,则直接可以在Project Interpreter中查看:
    在这里插入图片描述
    2.然后在系统高级设置中添加环境变量如下:
    在这里插入图片描述
    注意:这里的路径是上一步你查看得到的你当前python环境下,QT路径中的plugins文件夹

猜你喜欢

转载自blog.csdn.net/Blaststone/article/details/89350241