pyqt5在pycharm遇到的问题与解决(this application failed to start because no Qt platform plugin could be initi)

pyqt5的搭建让我特别头疼,搞了整整一天,在这边记录一下,防止下次安装再出错

1.下载pyqt5

2.执行install PyQt5 -i https://pypi.douban.com/simple安装pyqt5(如果提示无此命令则需要添加环境变量或者直接找到pyqt5的安装)路径, 搜索pip.exe, 在当前文件夹里面打开控制台(WIN系统), 执行 .\pip install PyQt5 -i https://pypi.douban.com/simple

3.安装pycharm, 会自动搜索pyqt5的库,如果不自动搜索,就手动去添加,File->setting->project->project interpreter->+搜索pyqt5

4.再继续安装pyqt5-stubs

5.设置环境变量,这一步很重要,否则运行GUI程序时, 就会被this application failed to start because no Qt platform plugin could be initialized, Reinstalling the application may fix this problem, available platform搞到崩溃!

1)用户环境变量

pyqt5在pycharm遇到的问题与解决(this application failed to start because no Qt platform plugin could be initi)_第1张图片

2)系统环境变量

 pyqt5在pycharm遇到的问题与解决(this application failed to start because no Qt platform plugin could be initi)_第2张图片

3)新建路径QT_PLUGIN_PATH,这一步很重要

 pyqt5在pycharm遇到的问题与解决(this application failed to start because no Qt platform plugin could be initi)_第3张图片

你可能感兴趣的:(pyqt5在pycharm遇到的问题与解决(this application failed to start because no Qt platform plugin could be initi))