当前位置:  开发笔记 > 编程语言 > 正文

在不同的Linux机器上部署PyQt5应用程序

如何解决《在不同的Linux机器上部署PyQt5应用程序》经验,为你挑选了0个好方法。

我一周以来一直在努力解决这个问题所以我想是时候寻求一些帮助了.简而言之:我正在使用Python 3.4和PyQt5构建一个应用程序,我正在使用cx_Freeze来创建我的应用程序的独立可执行文件.在Windows和Mac OS上一切正常我在未安装Qt5的Ubuntu操作系统上执行冻结应用程序时遇到此问题:

This application failed to start because it could not find or load the Qt platform plugin "xcb".

Available platform plugins are: linuxfb, minimal, offscreen, xcb.

应用程序在我用来构建冷冻包(安装Qt5的地方)的机器上运行正常.

我用Google搜索了一下,似乎这个问题很常见.我尝试了以下链接中找到的所有内容:

"在没有安装qt的Linux上启动qt5 app时,无法加载平台插件"xcb""

(Qt 5.4.1)此应用程序无法启动,因为它无法找到或加载Qt平台插件"xcb"

在冻结的应用程序中,我确实有平台目录libqxcb.so.为了保持一致性,我ldd libqxcb.so在两台安装了Qt5的机器上发布了相同的输出,而另一台我用于测试的地方,我只有一个新的Ubuntu 14.04安装(没有Qt5):

linux-vdso.so.1 =>  (0x00007fff563a3000)
libQt5XcbQpa.so.5 => not found
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007feddfeee000)
libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007feddfcec000)
libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007feddfadc000)
libSM.so.6 => /usr/lib/x86_64-linux-gnu/libSM.so.6 (0x00007feddf8d4000)
libICE.so.6 => /usr/lib/x86_64-linux-gnu/libICE.so.6 (0x00007feddf6b8000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007feddf499000)
libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007feddf25d000)
libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007feddefba000)
libQt5DBus.so.5 => /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5 (0x00007fedded3b000)
libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007feddeb39000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fedde931000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fedde629000)
libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007fedde41f000)
libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007fedde20d000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007feddded8000)
libQt5Gui.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5 (0x00007feddd88b000)
libQt5Core.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 (0x00007feddd1e5000)
libGL.so.1 => /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 (0x00007feddcf53000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007feddcd35000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007feddca31000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007feddc72b000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007feddc515000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007feddc150000)
/lib64/ld-linux-x86-64.so.2 (0x00007fede02f4000)
libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007feddbf4b000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007feddbd47000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007feddbb41000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007feddb917000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007feddb6fe000)
libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007feddb4d8000)
libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007feddb293000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007feddb055000)
libharfbuzz.so.0 => /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007feddae00000)
libicui18n.so.52 => /usr/lib/x86_64-linux-gnu/libicui18n.so.52 (0x00007fedda9f9000)
libicuuc.so.52 => /usr/lib/x86_64-linux-gnu/libicuuc.so.52 (0x00007fedda680000)
libglapi.so.0 => /usr/lib/x86_64-linux-gnu/libglapi.so.0 (0x00007fedda456000)
libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007fedda253000)
libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007fedda04d000)
libxcb-glx.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0 (0x00007fedd9e36000)
libxcb-dri2.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0 (0x00007fedd9c31000)
libxcb-dri3.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0 (0x00007fedd9a2e000)
libxcb-present.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-present.so.0 (0x00007fedd982b000)
libxcb-sync.so.1 => /usr/lib/x86_64-linux-gnu/libxcb-sync.so.1 (0x00007fedd9625000)
libxshmfence.so.1 => /usr/lib/x86_64-linux-gnu/libxshmfence.so.1 (0x00007fedd9423000)
libXxf86vm.so.1 => /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 (0x00007fedd921d000)
libdrm.so.2 => /usr/lib/x86_64-linux-gnu/libdrm.so.2 (0x00007fedd9011000)
libgraphite2.so.3 => /usr/lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007fedd8df5000)
libicudata.so.52 => /usr/lib/x86_64-linux-gnu/libicudata.so.52 (0x00007fedd7588000)

这同样适用于ldd Eddy(其中Eddy是应用程序可执行文件名):

linux-vdso.so.1 =>  (0x00007fffc812e000)
libpython3.4m.so.1.0 => /home/daniele/Desktop/eddy/build/Eddy-0.4-gpl-linux64/./libpython3.4m.so.1.0 (0x00007fab72345000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fab72127000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fab71d62000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007fab71b38000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fab7191f000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fab7171b000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007fab71518000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fab71212000)
/lib64/ld-linux-x86-64.so.2 (0x00007fab7297a000)

在我正在创建冻结应用程序的机器上,我尝试从源代码编译的Qt5和使用脱机安装程序安装的Qt5.我使用了从源代码和cx_Freeze 3.4.3编译的SIP 4.17PyQt5 5.5.1.

有什么建议?

编辑1:我已经尝试将libQt5XcbQpa.so.5(以及libQt5QCore.so.5等)移动到我的构建目录中,但它没有帮助.

推荐阅读
郑小蒜9299_941611_G
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有