惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
J
Java Code Geeks
IT之家
IT之家
Last Week in AI
Last Week in AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
B
Blog RSS Feed
P
Proofpoint News Feed
博客园 - Franky
MongoDB | Blog
MongoDB | Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 【当耐特】
Microsoft Security Blog
Microsoft Security Blog
I
InfoQ
B
Blog
Stack Overflow Blog
Stack Overflow Blog
Martin Fowler
Martin Fowler
博客园 - 聂微东
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Apple Machine Learning Research
Apple Machine Learning Research
大猫的无限游戏
大猫的无限游戏
U
Unit 42
aimingoo的专栏
aimingoo的专栏

博客园 - swordzj

安装qt5的运行环境 四舍六入五成双 用批处理在指定目录启动Notebook 华为S6700交换机的命名规则 给服务器来点压力 配置dovect监听多个端口 OpenSSH 9.2P1 aarch64 编译RPM包及升级处理过程 php7.4 注意事项 不重启服务器在线扩容FCSAN存储 WSUS安装后部署报CLR20错误 NFS服务端口转发 注册表模拟修改Wsus配置 Linux下删除大量文件 Seafile社区版集成Office Online Server实现office文件预览 Exchange 域用户无权管理邮箱 阿里云ECS(Centos)开启X11的步骤 微软官方提供的免费正版 Windows 8.1/Win10/7/XP/Vista 操作系统虚拟机镜像下载 在VS2012下静态链接MFC的问题 扩展BindingList,防止增加、删除项时自动更新界面而不出现“跨线程操作界面控件 corss thread operation”异常 【转】开源软件是否真的如我们想象中的那样安全?
从源码编译PyQt5的过程
swordzj · 2026-05-06 · via 博客园 - swordzj

在网上看了许多教程,都要安装sip模块再进行编译,但新的sip模块执行命令与之前有较大区别,最后还是看了官方文档才成功,下面把官方文档抄下面,做个记录。

1、安装编译工具

The solution to all these issues is to use the pyqt-bundle program to bundle a copy of your own Qt installation with your commercial PyQt5. This will produce a new wheel that you can distribute easily to your developers.

pyqt-bundle is part of PyQt-builder. To install it, run:

The documentation can be found here.

To uninstall the commercial version, run:

pip uninstall PyQt5-commercial

Building PyQt5

Once you have downloaded the sdist from PyPI, unpack it and change directory to its top level directory (i.e. the one containing the pyproject.toml file.

If you are building the commercial version of PyQt5 then copy the pyqt-commercial.sip license file to the sip sub-directory.

To build and install PyQt5, run:

In order to see all the available command line options, run:

sip-install -h

2、安装pyqt5-sip模块

Building the sip Module

It is not necessary to install the PyQt5.sip module before building PyQt5 but it must be installed before PyQt5 can be used.

The module is built using setuptools and is available from the PyQt5-sip project at PyPI. It uses setuptools as its build system and can be installed by pip or you can also unpack the sdist and install it by running its setup.py script.