【问题标题】:Executable created in CentOS not working in Ubuntu在 CentOS 中创建的可执行文件在 Ubuntu 中不起作用
【发布时间】:2014-05-29 21:55:19
【问题描述】:

我开发了一个 pygtk 应用程序。现在我必须将它部署在客户端机器上。

所以我在 CentOS 5 机器上使用 PyInstaller 创建了一个可执行文件(因为 Pyinstaller 依赖于 glibc 并且选择较低的 glibc 我使用了 centOS 5)。

现在,当我尝试在 Ubuntu11.04 机器中运行应用程序时,它会加载应用程序,但它会在 GUI 中显示方框而不是文本。

在命令行中打印以下错误消息。

Gtk-Message: Failed to load module "canberra-gtk-module": libcanberra-gtk-module.so: cannot open shared object file: No such file or directory
/tmp/_MEIwDbvRA/User.py:88: GtkWarning: Cannot open pixbuf loader module file '/home/arrowdevices/pda/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache': No such file or directory
/tmp/_MEIwDbvRA/User.py:94: GtkWarning: Cannot open pixbuf loader module file '/home/arrowdevices/pda/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache': No such file or directory
/tmp/_MEIwDbvRA/User.py:100: GtkWarning: Cannot open pixbuf loader module file '/home/arrowdevices/pda/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache': No such file or directory
/tmp/_MEIwDbvRA/User.py:114: GtkWarning: Cannot open pixbuf loader module file '/home/arrowdevices/pda/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache': No such file or directory
/tmp/_MEIwDbvRA/User.py:120: GtkWarning: Cannot open pixbuf loader module file '/home/arrowdevices/pda/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache': No such file or directory
/tmp/_MEIwDbvRA/User.py:130: GtkWarning: Cannot open pixbuf loader module file '/home/arrowdevices/pda/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache': No such file or directory
/tmp/_MEIwDbvRA/User.py:140: GtkWarning: Cannot open pixbuf loader module file '/home/arrowdevices/pda/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache': No such file or directory
/tmp/_MEIwDbvRA/User.py:197: PangoWarning: No modules found:
No builtin or dynamically loaded modules were found.
PangoFc will not work correctly.
This probably means there was an error in the creation of:
  '/home/arrowdevices/pda/etc/pango/pango.modules'
You should create this file by running:
  pango-querymodules > '/home/arrowdevices/pda/etc/pango/pango.modules'
Fontconfig warning: "/etc/fonts/conf.d/11-lcd-filter-lcddefault.conf", line 9: invalid constant used : lcddefault
Fontconfig warning: "/etc/fonts/conf.d/53-monospace-lcd-filter.conf", line 17: invalid constant used : lcdlegacy
/tmp/_MEIwDbvRA/User.py:197: PangoWarning: failed to find shape engine, expect ugly output. engine-type='PangoRenderFc', script='latin'
/tmp/_MEIwDbvRA/User.py:197: PangoWarning: failed to find shape engine, expect ugly output. engine-type='PangoRenderFc', script='common'
/tmp/_MEIwDbvRA/User.py:197: GtkWarning: Cannot open pixbuf loader module file '/home/arrowdevices/pda/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache': No such file or directory

我的问题:

  1. 如何将图标和字体干净地打包到 PyInstaller 创建的可执行文件中?
  2. Pyinstaller 似乎将文件路径硬编码到可执行文件中。我们怎样才能避免这种情况?

【问题讨论】:

    标签: linux centos pyinstaller ubuntu-11.04


    【解决方案1】:

    我会搜索 Ubuntu 二进制文件。 CentOS 和 Ubuntu 是非常非常不同的系统。目录结构可以变化。

    【讨论】:

    • 嗨@over-killer 我改变了问题,请看一下。我需要使用 pyinstaller 干净地打包图标和字体。我认为那么Ubuntu和CentOS之间应该没有区别
    • 好的。安装开发 GTK+ 文件。也安装 PangoFC。为了让它工作,我想知道。为什么你认为 Ubuntu 和 CentOS 之间没有区别? Ubuntu 基于 Debian,CentOS 基于 RHEL。他们使用不同的包管理器,目录结构也不同。
    • 嘿,我在另一台机器上安装了相同的 centos 5 并测试了我的应用程序,但它给出了同样的错误。知道为什么吗?
    • 你安装了我上面提到的所有开发库吗?
    • 嘿,我已将所有源代码(gtk、pygtk 包括 pango 和 cairo 所需)编译到本地目录并运行 pyinstaller。我没有单独找到 pangoFC 的任何包,我该如何安装?
    猜你喜欢
    • 1970-01-01
    • 2015-01-13
    • 1970-01-01
    • 1970-01-01
    • 2013-11-23
    • 2015-10-25
    • 1970-01-01
    • 2010-10-23
    • 1970-01-01
    相关资源
    最近更新 更多