python3 pyqt5安装、配置及pyqt5 tools安装失败解决

目录

一、pyqt5安装:

二、配置

三、各个个工具的功能


一、pyqt5安装:

pyqt5 tools安装失败解决:如果你是python3.10安装pyqt5,建议将python3.10降为python3.7,不然pyqt5 tools会安装失败,这也是pyqt5 tools安装失败的主要原因

pyqt5的安装主要有两种方法(推荐第二种):

第一种:IDE中安装(以pycharm为例),缺点是不能选择镜像网站,下载慢:

file —>settings —>project —>python interpreter

左上角‘+’

直接搜索pyqt5和pyqt5 tools,install就行了

第二种是cmd安装

win+r—>cmd

一般这里用国内镜像网站下载比较快(以清华大学为例):

pip install pyqt5 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install pyqt5-tools -i https://pypi.tuna.tsinghua.edu.cn/simple/

先安装pyqt5,再安装pyqt5 tools(有人这里说要先安装sip,pyqt5更新后sip已经再pyqt5中,不用单独安装)

这里提供一些国内较为好用的镜像网站

http://pypi.douban.com/simple/                     豆瓣

https://pypi.mirrors.ustc.edu.cn/simple/         中国科技大学

http://pypi.mirrors.opencas.cn/simple/           中科院

https://pypi.tuna.tsinghua.edu.cn/simple/       清华大学

二、配置

在pycharm中file—>settings—>tools—>External Tools—>左上方'+'

 QtDesigner配置

name:自己起就可以一般是QtDesigner

Program:Python\Lib\site-packages\pyqt5_tools\designer.exe 在自己Python安装目录下找

Arguments:  不填就可以
Working directory: $FileDir$

 Pyuic

 

name:自己起就可以一般是PyUic

Program:Python\Scripts\pyuic5.exe 在自己Python安装目录下找,不同版本位置可能不一样

Arguments:$FileName$ -o $FileNameWithoutExtension$.py
Working directory: $FileDir$

Pyrcc配置

 

name:自己起就可以一般是PyRcc

Program:Python\Scripts\pyrcc5.exe 在自己Python安装目录下找,不同版本位置可能不一样

Arguments:$FileName$ -o $FileNameWithoutExtension$.py
Working directory: $FileDir$

三、各个个工具的功能

QtDesigner:生成 .ui 的工具,也是设计工具可从tools—>External Tools调出

 Pyuic:.ui 转化成 .py文件

Pyrcc:将资源文件如图片等转成python代码能识别的文件

来源:pynewwu

物联沃分享整理
物联沃-IOTWORD物联网 » python3 pyqt5安装、配置及pyqt5 tools安装失败解决

发表评论