$LD_LIBRARY_PATH, cx_Freeze and wxPython

S

Simon John

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/
 
R

Roger Binns

[BTW you are far better off discussing this on the cx-Freeze mailing
lists]
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.

That is what you have to do with wxPython libraries (and for good and
complicated reasons). However cx-Freeze includes a stub that does
it for you. Look again at the wiki page you quoted:

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

ConsoleSetLibPathBase sets the LD_LIBRARY_PATH for you. For
cx-Freeze 3, the same named initscript does it.

Roger (also the author of the cx-Freeze bit on that wiki page)
 
S

Simon John

Yup, just found that --init-script=ConsoleSetLibPath myself, thanks,
seems to work on SUSE 9.1 Pro, well done with the Wiki Page BTW!

I also just found the mailing list, although at the time I wasn't sure
if it was a wxPython or cx_Freeze issue...

Now I've just got to find out why McMillan Installer segfaults on RHEL
3ES.....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,962
Messages
2,570,134
Members
46,692
Latest member
JenniferTi

Latest Threads

Top