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

标签 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 似乎将文件路径硬编码到可执行文件中。我们如何避免这种情况?

最佳答案

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

关于linux - 在 CentOS 中创建的可执行文件在 Ubuntu 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23085512/

相关文章:

python - 在 Linux 上使用 Python 进行视频捕获的最佳库是什么?

将静态内核驱动程序编译为模块

C++ Linux 服务 - 如何使用 init.d + 自动重启?

logging - Rsyslog - 日志未显示在服务器上

python - PyInstaller 中没有名为 'pandas._libs.tslibs.timedeltas' 的模块

linux - 无法通过 Putty 从 Linux 服务器复制大型 .py 文件

php - 没有为 Silex 安装 Symfony 组件

git 初始化 : Permission Denied

python - 使用 homebrew 安装 pyinstaller

python-3.x - 在PyInstaller中使用Configure.py时出现语法错误