在使用pip install python-qt5可以成功安装pyqt5,但无法安装pyqt5-tools
不知道你这个问题是否已经解决, 如果还没有解决的话: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/ 清华大学