Regarding the lxml import error only in a web-request

N

nagraj

I'm trying to run Django from Apache using FastCGI in a shared hosting
environment on DH. I've installed python 2.5.2 onto my home
environment. And all the necessary libraries including lxml 2.1.3,
libxml2, libxslt, flup, etc.


I'm facing a strange issue with lxml, which occurs only when it is
used from the webrequests. I'm getting the following error:


Exception Type: ImportError
Exception Value: ~/opt/lib/python2.5/site-packages/lxml-2.1.3-
py2.5-linux-x86_64.egg/lxml/etree.so: undefined
symbol:xmlSchematronSetValidStructuredErrors


it basically comes when i'm trying to do this in my Django views.py
from lxml import etree


But the same is running perfectly well in my python console. Even with
the following command it works well
python -c "from lxml import etree"


I've almost checked every installation and library paths.. not able to
figure out what exactly would be the issue.


Please help me.
Nagraj.
 
S

Stefan Behnel

nagraj said:
I'm trying to run Django from Apache using FastCGI in a shared hosting
environment on DH. I've installed python 2.5.2 onto my home
environment. And all the necessary libraries including lxml 2.1.3,
libxml2, libxslt, flup, etc.


I'm facing a strange issue with lxml, which occurs only when it is
used from the webrequests. I'm getting the following error:


Exception Type: ImportError
Exception Value: ~/opt/lib/python2.5/site-packages/lxml-2.1.3-
py2.5-linux-x86_64.egg/lxml/etree.so: undefined
symbol:xmlSchematronSetValidStructuredErrors


it basically comes when i'm trying to do this in my Django views.py
from lxml import etree


But the same is running perfectly well in my python console. Even with
the following command it works well
python -c "from lxml import etree"


I've almost checked every installation and library paths.. not able to
figure out what exactly would be the issue.

You most likely have an (older) system library of libxml2 and/or libxslt
installed. Try to use those *instead* of installing libxml2/libxslt
separately, or build lxml with the "--auto-rpath" option to make it
remember the path where the libraries were installed when it was compiled.

BTW, you do not need the Python bindings for those two libraries installed,
in case you are confusing the libxml2/libxslt Python modules with the
libxml2/libxslt libraries (which happens quite often).

Stefan
 

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,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top