2014-04-15 82 views
1

我開發了一個pygtk應用程序。現在我必須將它部署在客戶機上。在CentOS中創建的可執行文件在Ubuntu中不起作用

所以我在CentOS 5機器上創建了一個使用PyInstaller的可執行文件(因爲Pyinstaller依賴於glibc並選擇了使用centOS 5的較低glibc)。

現在,當我試圖在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似乎將文件路徑硬編碼到可執行文件中。我們如何避免這種情況?

回答

0

我會搜索Ubuntu二進制文件。 CentOS和Ubuntu分別是非常非常,不同的系統。目錄結構可能會有所不同。

+0

Hi @ over-killer我改變了問題,請看看。我需要使用pyinstaller乾淨地打包圖標和字體。我認爲Ubuntu和CentOS應該沒有區別 – user2109788

+0

好吧。安裝開發GTK +文件。也安裝PangoFC。爲了讓它工作,我想知道。 爲什麼你認爲Ubuntu和CentOS之間沒有區別? Ubuntu基於Debian,CentOS基於RHEL。他們使用不同的軟件包管理器,目錄結構不同。 –

+0

嘿我在另一臺機器上安裝了相同的centos 5並測試了我的應用程序,但它給出了相同的錯誤。任何想法爲什麼? – user2109788

相關問題