当前位置:网站首页>pip 安装 qt5 。
pip 安装 qt5 。
2022-06-11 02:37:00 【aheadkeeper】
首先:如果你的Python 3.79以上的版本,请将版本降到3.79或者以下。
其次:pip安装命令
直接pip安装即可:
pip install PyQt5
pip install pyqt5-tools
建议使用国内源,进行快速安装:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyqt5
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyqt5-tools2.2 PyCharm配置环境
启动PyCharm后,新建一个PyQt5空项目后,需要配置Qt Designer、pyuic、pyrcc工具,相关配置方法如下:
2.2.1 Qt Designer
Qt Designer 是通过拖拽的方式放置控件,并实时查看控件效果进行快速UI设计。
最终生成.ui文件(实质上是XML格式的文件),可以通过pyuic5工具转换成.py文件。
在Pycharm中,依次打开 File - Settings - Tools - External Tools,点击 + Create Tool,配置如下:
Name: QtDisigner
Program : C:\Python38\Lib\site-packages\pyqt5_tools\Qt\bin\designer.exe # 当前designer目录,请根据实际修改
Working directory: $FileDir$

PyQt5找不到Designer.exe的问题
designer.exe 的新路径:
%python_home%\Lib\site-packages\qt5_applications\Qt\bin\designer.exe
2.2.3 PyUIC配置
PyUIC主要是把Qt Designer生成的.ui文件换成.py文件。
在Pycharm中,依次打开 File - Settings - Tools - External Tools,点击 + Create Tool,配置如下:
Name: PyUIC
Program : C:\Python38\python.exe # 当前Python目录,请根据实际修改
Arguments: -m PyQt5.uic.pyuic $FileName$ -o $FileNameWithoutExtension$.py
Working directory: $FileDir$

边栏推荐
- 【冒泡排序的实现】
- Link list of high frequency written interview question brushing summary (distribution explanation & code annotation)
- 数据库唯一索引和普通索引的区别?
- The new colleague asked me what "where 1=1" means???
- Three ways of reflection
- GraphAcademy 课程讲解:《Neo4j 图数据科学基础》
- Openjudge noi 1.13 17: text layout
- Rs232/rs485 to 4G DTU uploading temperature and humidity sensor data based on Modbus protocol to remote TCP server
- Sword finger offer II 079 All subsets
- [MySQL 45 -10] Lesson 10 how MySQL selects indexes
猜你喜欢

完成千万元A轮融资,小象生活能否成为折扣界的“永辉”?

Will your company choose to develop data center?

Rs232/rs485 to 4G DTU uploading temperature and humidity sensor data based on Modbus protocol to remote TCP server

The two request sessionids of the same user are inconsistent ----- record the problem

CPT 102_LEC 17

Link list of high frequency written interview question brushing summary (distribution explanation & code annotation)

Question bank and answers for 2022 melting welding and thermal cutting operation certificate examination

蓝桥杯_小蓝吃糖果_鸽巢原理 / 抽屉原理

CocosCreator原生二次开发的正确姿势
![[new open source project] dynamic configuration task scheduling framework gobrs async joins the dromara open source community](/img/26/2d0c4e8f7f4055e614080fe526328c.png)
[new open source project] dynamic configuration task scheduling framework gobrs async joins the dromara open source community
随机推荐
Helm deploy traifik ingress
AOSP ~ 默认开启开发者模式
HUST Software Engineering (Experiment 2) -- TDD test driven development experiment.
弄懂了采矿业与碳中和的逻辑,就读懂了矿区无人驾驶的千亿市场
反射三种方式
Arduino使用NRF24L01模块进行无线通信
2022年熔化焊接与热切割操作证考试题库及答案
List 过滤、排序、校验等处理方法
Application of the remote acquisition IOT gateway of the Bashir trough flowmeter in open channel flow monitoring
Forest v1.5.22 发布!支持Kotlin
Go语言之Go 快速入门篇(一):第一个 Go 程序
HOSATAPD_ CLI debug using WiFi whitelist
When the interviewer opens his mouth, he comes to compose. Is this the case now?
CPT 102_ LEC 18
[C language classic]: inverted string
[189. rotation array]
码农的进阶之路 | 每日趣闻
怎样确保消息的可靠性投递?
Android P SoftAP start process
Sword finger offer II 079 All subsets