473,545 Members | 1,989 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
xmlXIncludeProc essFlags: referenced symbol not found
>>>
No PYTHON* environment variables are set for either user.

Any help would be appreciated.

Jianbing

Aug 14 '08 #1
2 2892
On 14 Aug, 22:43, jianbing.c...@g mail.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
xmlXIncludeProc essFlags: 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.or g.ukwrote:
On 14 Aug, 22:43, jianbing.c...@g mail.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
xmlXIncludeProc essFlags: 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
2178
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
1830
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: undefined symbol: libxml_xmlCreateOutputBuffer (I have Python 2.2 and Python 2.3 installed. Using Python 2.2, the libxml2/libxslt Python bindings work...
1
1873
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 nodes in it and I'm trying to get an element named 'element' (from an relaxng schema).
1
1617
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 do `./foo.py`, some "local" imports fails, I guess because current working directory is different. Is CWD the only difference between running...
1
2171
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 = doc.xpathNewContext() ctxt.xpathRegisterNs("xlink","http://www.w3.org/1999/xlink")
4
2235
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
4439
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 not found. Please check your libxml2 installation. Here's my configure line: ./configure --with-apxs2=/usr/local/apache2/bin/apxs...
0
1589
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 as follows php 5.1.4 mysql 4.1.10a-2.RHEL4.1 httpd-2.0.52-12.2.ent Redhat Enterprise Linux 4 To be able to configure and compile the source...
6
4535
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 libxml2 parser in SHIFT-JIS format. The following error is thrown by libxml2 -
0
7420
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7680
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
5349
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4966
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3476
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3459
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1908
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1033
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
731
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.