anaconda + pyqt5 + pycharm 安装,测试

1. 安装sip

pip install sip

2.安装pyqt5

pip install PyQt5

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

pip install PyQt5-stubs

3.pycharm 配置

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

anaconda + pyqt5 + pycharm 安装,测试

添加Qtdesigner.exe  路径 

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

anaconda + pyqt5 + pycharm 安装,测试

PyUIC

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

anaconda + pyqt5 + pycharm 安装,测试

Pyrcc

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

anaconda + pyqt5 + pycharm 安装,测试

4. 测试

新建项目

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

anaconda + pyqt5 + pycharm 安装,测试

保存为 login .ui

anaconda + pyqt5 + pycharm 安装,测试

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

anaconda + pyqt5 + pycharm 安装,测试

然后添加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_())

anaconda + pyqt5 + pycharm 安装,测试

安装参考: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