help on import libxml2

Discussion in 'Python' started by jianbing.chen@gmail.com, Aug 14, 2008.

  1. Guest

    Hi,

    I have this weird situation where on the same machine(solaris 8,
    python 2.5), one user can do this with no problem:

    >>> import libxml2
    >>> libxml2

    <module 'libxml2' from '/usr/local/lib/python2.5/site-packages/
    libxml2.py'>
    >>>



    While the another one get this:
    >>> import libxml2

    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/sea/local/lib/python2.5/site-packages/libxml2.py", line 1, in
    <module>
    import libxml2mod
    ImportError: ld.so.1: python: fatal: relocation error: file /usr/local/
    lib/python2.5/site-packages/libxml2mod.so: symbol
    xmlXIncludeProcessFlags: referenced symbol not found
    >>>


    No PYTHON* environment variables are set for either user.

    Any help would be appreciated.

    Jianbing
     
    , Aug 14, 2008
    #1
    1. Advertising

  2. Paul Boddie Guest

    On 14 Aug, 22:43, wrote:
    >
    > Traceback (most recent call last):
    > File "<stdin>", line 1, in <module>
    > File "/sea/local/lib/python2.5/site-packages/libxml2.py", line 1, in
    > <module>
    > import libxml2mod
    > ImportError: ld.so.1: python: fatal: relocation error: file /usr/local/
    > lib/python2.5/site-packages/libxml2mod.so: symbol
    > xmlXIncludeProcessFlags: referenced symbol not found


    The symbol mentioned should be found in the libxml2.so library file
    (which I discovered by running nm on the static libxml2.a file). On my
    Ubuntu system, if I run the ldd program on the libxml2mod.so file (in
    a different place to where yours lives), I get the following results:

    ldd /var/lib/python-support/python2.5/libxml2mod.so
    linux-gate.so.1 => (0xffffe000)
    libxml2.so.2 => /usr/lib/libxml2.so.2 (0xb7e0b000)
    libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7cca000)
    libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7cc5000)
    libz.so.1 => /usr/lib/libz.so.1 (0xb7cb1000)
    libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7c8a000)
    /lib/ld-linux.so.2 (0x80000000)

    I suggest you run ldd on /usr/local/lib/python2.5/site-packages/
    libxml2mod.so for each user and see what it tells you. Perhaps there
    are permissions issues on the libxml2.so files, wherever they are
    installed, or there's a LD_LIBRARY_PATH (or equivalent) setting that
    one user has that the other doesn't.

    Paul
     
    Paul Boddie, Aug 14, 2008
    #2
    1. Advertising

  3. Guest

    Paul,

    Thanks. This helped.

    Jianbing

    On Aug 14, 4:10 pm, Paul Boddie <> wrote:
    > On 14 Aug, 22:43, wrote:
    >
    >
    >
    > > Traceback (most recent call last):
    > >   File "<stdin>", line 1, in <module>
    > >   File "/sea/local/lib/python2.5/site-packages/libxml2.py", line 1, in
    > > <module>
    > >     import libxml2mod
    > > ImportError: ld.so.1: python: fatal: relocation error: file /usr/local/
    > > lib/python2.5/site-packages/libxml2mod.so: symbol
    > > xmlXIncludeProcessFlags: referenced symbol not found

    >
    > The symbol mentioned should be found in the libxml2.so library file
    > (which I discovered by running nm on the static libxml2.a file). On my
    > Ubuntu system, if I run the ldd program on the libxml2mod.so file (in
    > a different place to where yours lives), I get the following results:
    >
    >   ldd /var/lib/python-support/python2.5/libxml2mod.so
    >         linux-gate.so.1 =>  (0xffffe000)
    >         libxml2.so.2 => /usr/lib/libxml2.so.2 (0xb7e0b000)
    >         libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7cca000)
    >         libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7cc5000)
    >         libz.so.1 => /usr/lib/libz.so.1 (0xb7cb1000)
    >         libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7c8a000)
    >         /lib/ld-linux.so.2 (0x80000000)
    >
    > I suggest you run ldd on /usr/local/lib/python2.5/site-packages/
    > libxml2mod.so for each user and see what it tells you. Perhaps there
    > are permissions issues on the libxml2.so files, wherever they are
    > installed, or there's a LD_LIBRARY_PATH (or equivalent) setting that
    > one user has that the other doesn't.
    >
    > Paul
     
    , Aug 15, 2008
    #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. Alain Ketterlin

    libxml2/libxslt crash

    Alain Ketterlin, Feb 26, 2004, in forum: XML
    Replies:
    0
    Views:
    507
    Alain Ketterlin
    Feb 26, 2004
  2. Replies:
    1
    Views:
    556
    Patrick TJ McPhee
    Mar 2, 2004
  3. Replies:
    0
    Views:
    494
  4. Ale Vesely
    Replies:
    0
    Views:
    589
    Ale Vesely
    Mar 21, 2005
  5. Andrew Marlow
    Replies:
    2
    Views:
    408
    Andrew Marlow
    Jan 18, 2007
Loading...

Share This Page