在CentOS中创建的可执行文件在Ubuntu中不起作用

时间:2014-04-15 13:42:29

标签: linux centos pyinstaller ubuntu-11.04

我开发了一个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似乎是将文件路径硬编码到可执行文件中。我们怎样才能避免这种情况?

1 个答案:

答案 0 :(得分:0)

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