1、准备工作
下载 pyqt5:https://sourceforge.net/projects/pyqt/files/PyQt5/ 下载zip文件
下载 sip :点击打开链接
下载 python:点击打开链接
下载 mingw:点击打开链接
下载 qt5:http://download.qt.io/archive/qt/ 下载mingw版本
qtcreator: http://download.qt.io/official_releases/qtcreator
2、设置环境变量
解压 pyqt5 到指定目录,安装qt5到指定目录,安装python,安装mingw
#ifndef Py_PYTHON_H
#define Py_PYTHON_H
#include "math.h"
3、编译
打开CMD命令行
首先编译sip
进入sip根目录,执行下面命令:
python configure.py -p win32-g++
make
make install
然后编译PyQt
进入pyqt根目录,执行下面的命令:
python configure.py --spec win32-g++ --confirm-license
或者
python configure.py --spec win32-g++ --confirm-license --disable=QtPositioning --disable=QtNfc --disable=QtBluetooth --no-designer-plugin --no-qml-plugin
make
make install
之后就可以在Lib\site-packages\PyQt5看到你编译好的qt5的pyd绑定
部分参考:
http://python.6.x6.nabble.com/Building-PyQt-on-Windows-problems-generating-the-C-code-td5212692.html
https://zhuanlan.zhihu.com/p/20528827
http://blog.youkuaiyun.com/sqn614/article/details/68946756
本文详细介绍了在Windows环境下安装PyQt5的过程,包括所需软件的下载与配置、环境变量的设置、编译sip及PyQt5的具体步骤,以及解决常见错误的方法。
253

被折叠的 条评论
为什么被折叠?



