
此时sip安装在python文件夹中,未进入系统路径,这时候在命令行中输入 :
sip -V #会提示找不到sip
本机中python 通过sys.path(),找到路径为:/usr/local/python3 ;sip在其bin 文件夹下面
请执行
进入PyQt文件夹
python configure.py
make
sudo make install
Linux系统下Qt5编译好的程序在未安装Qt的系统下运行会报以下错误:This application failed to start because it could not find or load the Qt platform plugin "xcb".Reinstalling the application may fix this problem.出现这个错误,主要是因为qt5为了在多平台下更方便移植,使用了一种新的技术-----platform abstraction system (QPA),而它中的库又依赖于Qt5中的一个库文件libQt5DBus.so.5,所以,只要打包时只要加上这个文件就可以了。linux下qt5程序打包步骤如下1、把以下7个库文件放到/usr/lib目录下libQt5Widgets.so.5libQt5Gui.so.5libQt5Core.so.5libicui18n.so.51libicuuc.so.51libicudata.so.51libQt5DBus.so.52、拷贝Qt5安装目录中的platforms目录,使它和你的Qt程序同级目录现在你可以双击你的程序运行了呵呵1,打开windows 的cmd窗口,切换到python命令界面,确认pip3是否安装2,联网,输入
pip3 install PyQt5
即可自动化下载安装,大小约80M,下载安装速度取决于网速。
3,测试安装正确
import PyQt5 没有报错即为安装成功。
也可做一个测试程序验证。
import sys
from PyQt5 import QtWidgets, QtCore
app = QtWidgets.QApplication(sys.argv)
widget = QtWidgets.QWidget()
widget.resize(400, 100)
widget.setWindowTitle("Hello World!")
widget.show()
exit(app.exec_())
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)