PyQt5安装与配置QtDesigner详解及问题解决.
- 安装PyQt5:
pip install PyQt5==5.12.3
- 安装PyQt5-Tools:
pip install pyqt5-tools==5.12.3.1.5
- 配置Qt Designer:
Name:QtDesigner Program:F:\Anaconda3\Lib\site-packages\pyqt5_tools\Qt\bin\designer.exe Working directory:$FileDir$
- 配置PyUIC(UI转换工具):
Name:PyUIC Program:F:\Anaconda3\Scripts\pyuic5.exe Arguments:$FileName$ -o $FileNameWithoutExtension$.py Working directory:$FileDir$
- 配置PyRcc(用于PyQt5的资源文件转码):
Name:PyRcc Program:F:\Anaconda3\Scripts\pyrcc5.exe Arguments:$FileName$ -o $FileNameWithoutExtension$.py Working directory:$FileDir$
配置完成即可在PyCharm中的【Tools】中看到三个扩展工具。
若使用QtDesigner时报错:
This application failed to start because no Qt platform plugin could be initialized.
解决办法:
1.删除环境变量:
2.卸载原版本的PyQt5和PyQt5-Tools,安装更低版本的PyQt5和PyQt5-Tools.(自研方法行之有效)