469,621 Members | 1,745 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,621 developers. It's quick & easy.

help on import libxml2

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 '08 #1
2 2753
On 14 Aug, 22:43, jianbing.c...@gmail.com 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 14 '08 #2
Paul,

Thanks. This helped.

Jianbing

On Aug 14, 4:10*pm, Paul Boddie <p...@boddie.org.ukwrote:
On 14 Aug, 22:43, jianbing.c...@gmail.com 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 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by laura | last post: by
1 post views Thread by Logan | last post: by
1 post views Thread by Brian Donovan | last post: by
1 post views Thread by Frans Englich | last post: by
1 post views Thread by bdecker | last post: by
4 posts views Thread by ankit | last post: by
1 post views Thread by Scott | last post: by
reply views Thread by Reestit Mutton | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.