472,368 Members | 2,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,368 software developers and data experts.

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 2831
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: laura | last post by:
newbie... expath vs libxml2... libxml2 is an implementation of dom expath is a sax parser both comes with php installation (ie 4.3) both need to have php recompiled:
1
by: Logan | last post by:
I always get the following error message when trying to import either the libxml2 or the libxslt module (Python 2.3 / Linux): ImportError: /usr/lib/python2.3/site-packages/libxml2mod.so:...
1
by: Brian Donovan | last post by:
Hi All, I'm trying to get xpath to work with the libxml2 python bindings. I'm using the following doc = libxml2.parseFile(filename) result = doc.xpathEval('//*') My test XML file has 10...
1
by: Frans Englich | last post by:
Hello all, I have a couple of questions related to module importing. 1) When I start my Python program with `python foo.py` instead of simply adding a interpreter comment on the first line and...
1
by: bdecker | last post by:
Hello, I was hoping that someone here can please answer two questions concerning libxml2 python module use: 1. Is this snippet correct? doc = libxml2.parseDoc(readfile(filename)) ctxt =...
4
by: ankit | last post by:
I am parsing xml file using libxml2 and for navigating the document object tree I want to use minidom. Is it possible. Can anyone give me any example for the same ?
1
by: Scott | last post by:
I'm trying to install PHP 5.1.2 on Fedora 4. Everything on configure goes ok until this: checking libxml2 install dir... /usr/lib checking for xml2-config path... configure: error: xml2-config...
0
by: Reestit Mutton | last post by:
I'm trying to get the mysqli object-oriented syntax to work in php. I understand that I have to have at least version 5 of php - I've therefore opted for version 5.1.4. The remainder of my setup is...
6
by: saumya.agarwal | last post by:
Hi, I am using libxml2 for xml parsing. When the client application sends data to libxml2 in UTF-8 format, it works fine. But, I have a scenarion in which the client application sends data to...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.