Hi all,
I am having problems trying to make a binary distribution on Linux for
a Python script using wxPython.
I am using cx_freeze 3.0.1 to generate a stand-alone executable and
when I want to execute the program on a Linux platform where wxPython
is not installed I get this error:
Traceback (most recent call last):
File "/home/alsina/meu/cx_Freeze/cx_Freeze-3.0.1/initscripts/Console.py",
line 26, in ?
File "TASverterGUI.py", line 51, in ?
File "/usr/lib/python2.4/site-packages/wx/__init__.py", line 45, in ?
File "/usr/lib/python2.4/site-packages/wxPython/__init__.py", line 20, in ?
File "ExtensionLoader.py", line 12, in ?
ImportError: libwx_gtk-2.4.so: cannot open shared object file: No such
file or directory
Googling around I've found this link:
http://wiki.wxpython.org/index.cgi/CreatingStandaloneExecutables
Here they talk about hardcoded pathnames in the wxPython shared
libraries, which is likely what's causing the error I get. Anyhow,
I've downloaded and compiled this chrpath utility, which should remove
the hardcoded paths but it does nothing when I pass the libraries
containing the hardcoded references to it.
- Does anybody knows if this is what should be done to remove theses references?
- In any case, am I following the ritght way to generate stand-alone
executables for Python scripts using wxPython or there's a better
option?
I am using Python2.4, wxPython 2.4.2.4, cx_freeze 3.0.1 and chrpath 0.13
Some details about the steps I follow:
$ export PATH=~/meu/cx_Freeze/cx_Freeze-3.0.1:$PATH
$ FreezePython --install-dir dist --base-name Console --init-script
ConsoleSetLibPath.py TASverterGUI.py
...
Then I execute this shell script, which can be found in the
wiki.wxPython website:
#!/bin/sh
for i in *.so
do
if chrpath $i 2>/dev/null | grep = >/dev/null
then
echo "Fixing $i"
chrpath -d $i
fi
done
Nothing happens anyhow. If I run "$ ldd wx*.so | grep wx" I still get this:
wxPython.htmlc.so:
libwx_gtk-2.4.so => /usr/lib/libwx_gtk-2.4.so (0x40055000)
wxPython.wxc.so:
libwx_gtk-2.4.so => /usr/lib/libwx_gtk-2.4.so (0x4026b000)
Any help will be very much appreciated. Thanks in advance!!!
David