anaconda + pyqt5 + pycharm 安装,测试
阅读原文时间:2023年07月08日阅读:3

pip install sip

pip install PyQt5

pip install PyQt5-tools -i http://pypi.douban.com/simple --trusted-host=pypi.douban.com

pip install PyQt5-stubs

打开Pycharm,进入设置,添加外部工具

添加Qtdesigner.exe  路径

F:\Anaconda\Lib\site-packages\pyqt5_tools\Qt\bin\designer.exe

PyUIC

Name : PyUIC
Programe : F:\Anaconda\Scripts\pyuic5.exe
Arguments : $FileName$ -o $FileNameWithoutExtension$.py
Working directory : $FileDir$

Pyrcc

Pyrcc
Programe : F:\Anaconda\Scripts\pyrcc5.exe
Arguments : $FileName$ -o $FileNameWithoutExtension$_rc.py
Working directory : $FileDir$

新建项目

TOOLS -external tools 使用QtDesigner 设计mainwindow     Form -> Preview可以预览

保存为 login .ui

然后选中login.ui ,右键使用 External Tools   PyUIC 转换为py文件

然后添加main 文件,引用 login

import sys
import login
from PyQt5.QtWidgets import QApplication, QMainWindow

if __name__ == '__main__':
app = QApplication(sys.argv)
MainWindow = QMainWindow()
ui = login.Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())

安装参考:https://blog.csdn.net/qq_38232378/article/details/94979661

https://www.cnblogs.com/dalanjing/p/6978373.html

QTdesigner 参考

https://www.jianshu.com/p/5b063c5745d0

https://blog.csdn.net/shangxiaqiusuo1/article/details/81035046

https://github.com/maicss/PyQt5-Chinese-tutorial

http://code.py40.com/pyqt5/16.html