$LD_LIBRARY_PATH, cx_Freeze and wxPython

Simon John simoninusa2001 at yahoo.co.uk
Sun Sep 19 01:24:22 EDT 2004


I'm using cx_Freeze (3b3?) to freeze a wxPython application for use
across various Linux versions.

If I build on one Linux distro, the binary is often incompatible with
another distro, giving the error:

Traceback (most recent call last):
File "/home/simon/python/cx_Freeze/initscripts/Console.py", line 23,
in ?
File "source/pyjournal.py", line 23, in ?
File "/usr/lib/python2.3/site-packages/wx/__init__.py", line 42, in ?
File "/usr/lib/python2.3/site-packages/wx/_core.py", line 4, in ?
File "ExtensionLoader.py", line 11, in ?
ImportError: libwx_gtkd_html-2.5.so.2: cannot open shared object file:
No such file or directory

I can't even get compatibility between RHEL 3ES, Fedora Core 1 and
RedHat 9, which are all practically the same distro! Same goes for SUSE
9.1 Pro and SLES 9.

The only way I can fix this is to set LD_LIBRARY_PATH to the program
directory i.e., force .so files in the current directory to be used
(instead of looking in /usr/lib and failing) or, if wxPython is
installed, set the LD_LIBRARY_PATH to point to that.

My question is why aren't the CWD files used - surely that's the whole
point of freezing - to bundle all shared object files so you don't have
to have them installed in /usr/lib/wxPython?!

I tried using chrpath as mentionned here....

http://wiki.wxpython.org/index.cgi/CreatingStandaloneExecutables

....But that just stopped the machine trying to run the program from
looking in /usr/lib/wxPython (so it wouldn't even work if the machine
had wxPython installed!)

I guess I could write a shell script to find the program directory, set
it as the LD_LIBRARY_PATH and then run the program, but that seems
horribly hacky.

You can have a go at the binaries yourself if you like (and get the
source) at:

http://www.the-jedi.co.uk/comps/downloads/pyjournal/




More information about the Python-list mailing list