欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

PyQt 5 + Windows 10开发环境配置

程序员文章站 2022-09-13 21:52:26
PyQt 5 + Windows 10开发环境配置前序步骤安装好Python3.X(或 Anaconda 3)的环境。安装PyQt5包如果需要最新版本,那么建议:pip install PyQt5 PyQt5_sip pyqt5_tools具体来说安装Qt基础包pip install PyQt5-5.15.0-5.15.0-cp35.cp36.cp37.cp38-none-win_amd64.whl安装Qt-tools工具包,用于调用Qt Designer工具pip inst...

PyQt 5 + Windows 10开发环境配置

前序步骤

安装好Python3.X(或 Anaconda 3)的环境。

安装PyQt5包

如果需要最新版本,那么建议:

pip install PyQt5 PyQt5_sip pyqt5_tools

具体来说

  1. 安装Qt基础包
pip install PyQt5-5.15.0-5.15.0-cp35.cp36.cp37.cp38-none-win_amd64.whl
  1. 安装Qt-tools工具包,用于调用Qt Designer工具
pip install pyqt5_tools-5.15.0.1.7-cp37-cp37m-win_amd64.whl
  1. 安装Qt-sip工具包
pip install PyQt5_sip-12.8.0-cp37-cp37m-win_amd64.whl

设定系统环境变量

1.右击计算机,点击属性,点击高级系统设置,点击环境变量,点击计算机用户变量Path,在里面加入下文,如果安装的是Python3.X,那么下面Anaconda3改为“Python3X”

D:\Anaconda3\Lib\site-packages\PyQt5\Qt\bin
D:\Anaconda3\Lib\site-packages\pyqt5_tools\Qt\bin  

2.完成后点击确定,点击用户新建环境变量,新建环境变量QT_PLUGIN_PATH

D:\Anaconda3\Lib\site-packages\PyQt5\Qt\plugins;
D:\Anaconda3\Lib\site-packages\pyqt5_tools\Qt\plugins;
D:\Anaconda3\Lib\site-packages\pyqt5_tools\Qt\bin\plugins;

彼此之间用分号分开,完成后点击确定。
3.QT_QPA_PLATFORM_PLUGIN_PATH
D:\Anaconda3\Lib\site-packages\pyqt5_tools\Qt\plugins\platforms;
D:\Anaconda3\Lib\site-packages\PyQt5\Qt\plugins\platforms;
D:\Anaconda3\Lib\site-packages\pyqt5_tools\Qt\bin\platforms;
彼此之间用分号分开,完成后点击确定,点击环境变量最下方的确认。
即可,至此,配置完成。
右击D:\Anaconda3\Lib\site-packages\pyqt5_tools\Qt\bin\下面的designer.exe,可以看到
PyQt 5 + Windows 10开发环境配置

参考链接

PyCharm安装配置Qt Designer+PyUIC教程

Pycharm安装PyQt5和pyqt5-tools从而使用Qt Designer

Qt 地址,清华大学镜像,下的更快

安装PyQt5并解决This application failed to start because it could not find or load the Qt platform plugin"

pyqt5解决could not find or load the Qt platform plugin windows

本文地址:https://blog.csdn.net/xbs150/article/details/107159569