help on import libxml2

J

jianbing.chen

Hi,

I have this weird situation where on the same machine(solaris 8,
python 2.5), one user can do this with no problem:
<module 'libxml2' from '/usr/local/lib/python2.5/site-packages/
libxml2.py'>

While the another one get this: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
 
P

Paul Boddie

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
 
J

jianbing.chen

Paul,

Thanks. This helped.

Jianbing

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
 

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

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top