赞
踩
在Xariver上安装pyqt5,但是使用pip install pyqt5 方法时上会出现类似下面这样的问题,或者就是卡住无法继续
Successfully installed PyQt-builder-1.13.0 packaging-21.3 ply-3.11 pyparsing-3.0.9 setuptools-65.3.0 sip-6.6.2 toml-0.10.2
Cleaning up...
Removing source in /tmp/pip-install-2gmr_frd/sip
Removed build tracker: '/tmp/pip-req-tracker-vuj8lfsc'
Installing build dependencies ... done
Running command /usr/bin/python3 /tmp/tmppi_h1r7x get_requires_for_build_wheel /tmp/tmpx88x82dh
Getting requirements to build wheel ... done
Created temporary directory: /tmp/pip-modern-metadata-b__1na9b
Running command /usr/bin/python3 /tmp/tmpwp46ffki prepare_metadata_for_build_wheel /tmp/tmpxrg1n2t9
Querying qmake about your Qt installation...
This is the GPL version of PyQt 5.15.7 (licensed under the GNU General Public License) for Python 3.8.10 on linux.
Type 'L' to view the license.
Type 'yes' to accept the terms of the license.
Type 'no' to decline the terms of the license.
安装PyQt5以及SIP,PyQt5版本需与SIP要对应
sip 4.19.25 下载
pyqt5 5.15.2 下载
## 1.源码编译需要依赖qmake工具链 sudo apt-get install qt5-default ## 2.安装编译所需的软件包 sudo apt-get install cmake gcc g++ pip3 install --upgrade pip pip3 install wheel setuptools ##3.编译SIP包 tar zxvf sip-4.19.25.tar.gz cd ./sip-4.19.25 python configure.py --sip-module PyQt5.sip ## sudo make sudo make install ##4.编译 PyQt5 tar zxvf PyQt5-5.15.2.tar.gz cd ./PyQt5-5.15.2 python configure.py sudo make -j4 sudo make install
#测试PyQt5的功能
import sys
from PyQt5 import QtWidgets, QtCore
app = QtWidgets.QApplication(sys.argv)
widget = QtWidgets.QWidget()
widget.resize(360, 360)
widget.setWindowTitle("Hello, World")
widget.show()
sys.exit(app.exec_())
ok!
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。