PyQt5-环境搭建

Mac搭建

1、安装homebrew
2、terimal :brew install python3
3、terimal :brew install PyQt5 # 同时会自动安装qt
4、与pyCharm建立交互 # MacOS, 如果通过 terminal 安装 PyQt5,Designer安装路径在:/usr/local/Cellar/qt/X.X/libexec/

前提:

1、cmd:pip3 install PyQt5
2、cmd: pip install PyQt5-tools # 安装PyQT5-tools,用以交互pycharm
3、安装 PyQt5-5.4.1-gpl-Py3.4-Qt5.4.1-x64
其他:cmd:pip install whl_file_.whl # 安装whl文件

与pycharm交互(external tools setting)
  • PyUIC # func:convert ui 2 py
  1. program :C:\Users\Administrator\AppData\Local\Programs\Python\Python36\python.exe
arguments :-m PyQt5.uic.pyuic $FileName$ -o $FileNameWithoutExtension$.py
working directory :$FileDir$

2.使用ui2PyCode.py
         https://blog.csdn.net/cm731231988/article/details/80261196

1、也可用如下cmd输入命令的方式,使用前必须将如下python.exe的路径加入环境变量
pyuic A.ui -o B.py # 在cmd中输入此命令可将A.ui->B.py

  • QTDesigner # func:call QTDesigner
program : C:\Python34 \Lib\site-packages\PyQt5\designer.exe
working directory :$ProjectFileDir$

  • Pyqcc # func:convert resource
program : C:\Python34 \Lib\site-packages\PyQt5\pyrcc5.exe
parameters :$FileName$ -o $FileNameWithoutExtension$_rc.py
working directory :$FileDir$


你可能感兴趣的:(PyQt5)