$LD_LIBRARY_PATH, cx_Freeze and wxPython

Discussion in 'Python' started by Simon John, Sep 19, 2004.

  1. Simon John

    Simon John Guest

    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/
     
    Simon John, Sep 19, 2004
    #1
    1. Advertising

  2. Simon John

    Roger Binns Guest

    [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)
     
    Roger Binns, Sep 19, 2004
    #2
    1. Advertising

  3. Simon John

    Simon John Guest

    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.....
     
    Simon John, Sep 19, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Naresh Agarwal
    Replies:
    0
    Views:
    862
    Naresh Agarwal
    Jun 30, 2005
  2. Brian Cole
    Replies:
    0
    Views:
    328
    Brian Cole
    Jan 21, 2006
  3. =?ISO-8859-1?Q?Gerhard_H=E4ring?=

    Re: Compiling cx_Oracle and LD_LIBRARY_PATH

    =?ISO-8859-1?Q?Gerhard_H=E4ring?=, Jan 21, 2006, in forum: Python
    Replies:
    0
    Views:
    405
    =?ISO-8859-1?Q?Gerhard_H=E4ring?=
    Jan 21, 2006
  4. Replies:
    1
    Views:
    368
    Gordon Beaton
    Jan 11, 2008
  5. Replies:
    2
    Views:
    141
    Lennon Day-Reynolds
    Aug 19, 2004
Loading...

Share This Page