"from lxml import etree" leads to ImportError on Lxml-3.0.1
![](https://secure.gravatar.com/avatar/e733d57fce4c55f2eb1adfca8074328b.jpg?s=120&d=mm&r=g)
from lxml import etree Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: /share/HDA_DATA/.qpkg/Python/lib/python2.7/site-packages/lxml-3.0.1-
When i try "from lxml import etree" is give be the following ImportError: py2.7-linux-armv5tel.egg/lxml/etree.so: undefined symbol: __xmlStructuredErrorContext I've tried downgrading to lxml 3.0, 2.3.6, and 2.3.5 - its the same error. Any suggestions on what needs to be adjusted?
![](https://secure.gravatar.com/avatar/6af55f57c08a9fdaa2d70f57d2a7a9d5.jpg?s=120&d=mm&r=g)
I had a similar error a couple of weeks ago. What I ended up doing was rebuilding lxml with the following command: python setup.py --static-deps --libxml2-version=2.7.8 --libxslt-version=1.1.21 I may have misremembered the "version" options, but they should be in setupinfo.py somewhere. Hope this helps, Patrick -- J. Patrick Narkinsky patrick@narkinsky.com “Faith in God's revelation has nothing to do with an ideology which glorifies the status quo.” – Karl Barth On Wed, Nov 7, 2012, at 09:40 PM, L. Dubyzu wrote:
When i try "from lxml import etree" is give be the following ImportError:
from lxml import etree Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: /share/HDA_DATA/.qpkg/Python/lib/python2.7/site-packages/lxml-3.0.1- py2.7-linux-armv5tel.egg/lxml/etree.so: undefined symbol: __xmlStructuredErrorContext
I've tried downgrading to lxml 3.0, 2.3.6, and 2.3.5 - its the same error. Any suggestions on what needs to be adjusted?
_________________________________________________________________ Mailing list for the lxml Python XML toolkit - http://lxml.de/ lxml@lxml.de https://mailman-mail5.webfaction.com/listinfo/lxml
![](https://secure.gravatar.com/avatar/e733d57fce4c55f2eb1adfca8074328b.jpg?s=120&d=mm&r=g)
J. Patrick Narkinsky <patrick <at> narkinsky.com> writes:
I had a similar error a couple of weeks ago. What I ended up doing was rebuilding lxml with the following command:
python setup.py --static-deps --libxml2-version=2.7.8 --libxslt-version=1.1.21
I may have misremembered the "version" options, but they should be in setupinfo.py somewhere.
Hope this helps,
Patrick
Thanks for the suggestion. It didnt work- the build failed. I got this error message: config.status: error: could not create Makefile Traceback (most recent call last): File "setup.py", line 226, in <module> **setup_extra_options() File "setup.py", line 139, in setup_extra_options STATIC_CFLAGS, STATIC_BINARIES) File "/share/HDA_DATA/src/pyliball/lxml-3.0.1/setupinfo.py", line 57, in ext_modules multicore=OPTION_MULTICORE) File "/share/HDA_DATA/src/pyliball/lxml-3.0.1/buildlibxml.py", line 327, in build_libxml2xslt cmmi(configure_cmd, libiconv_dir, multicore, **call_setup) File "/share/HDA_DATA/src/pyliball/lxml-3.0.1/buildlibxml.py", line 257, in cmmi call_subprocess(configure_cmd, cwd=build_dir, **call_setup) File "/share/HDA_DATA/src/pyliball/lxml-3.0.1/buildlibxml.py", line 249, in call_subprocess raise Exception('Command "%s" returned code %s' % (cmd_desc, returncode)) Exception: Command "./configure --disable-dependency-tracking --disable-shared - -prefix=/share/HDA_DATA/src/pyliball/lxml-3.0.1/build/tmp/libxml2" returned code 256 Any ideas on what to do next?
![](https://secure.gravatar.com/avatar/8b97b5aad24c30e4a1357b38cc39aeaa.jpg?s=120&d=mm&r=g)
L. Dubyzu, 08.11.2012 05:47:
J. Patrick Narkinsky writes:
I had a similar error a couple of weeks ago. What I ended up doing was rebuilding lxml with the following command:
python setup.py --static-deps --libxml2-version=2.7.8 --libxslt-version=1.1.21
I may have misremembered the "version" options, but they should be in setupinfo.py somewhere.
Thanks for the suggestion. It didnt work- the build failed. I got this error message:
config.status: error: could not create Makefile
Could you provide the context before this line please? Maybe your hard drive just filled up or something. Stefan
![](https://secure.gravatar.com/avatar/e733d57fce4c55f2eb1adfca8074328b.jpg?s=120&d=mm&r=g)
Stefan Behnel <stefan_ml <at> behnel.de> writes:
Could you provide the context before this line please?
Maybe your hard drive just filled up or something.
Stefan
Ok. Here's a link to the log i copied to a text file: https://www.sugarsync.com/pf/D7596452_754_934708328 It was too long to be directly pasted here. Thanks!
![](https://secure.gravatar.com/avatar/8b97b5aad24c30e4a1357b38cc39aeaa.jpg?s=120&d=mm&r=g)
L. Dubyzu, 08.11.2012 16:45:
Stefan Behnel <stefan_ml <at> behnel.de> writes:
Could you provide the context before this line please? Maybe your hard drive just filled up or something.
Ok. Here's a link to the log i copied to a text file:
https://www.sugarsync.com/pf/D7596452_754_934708328
It was too long to be directly pasted here. Thanks!
It's that long because it's full of errors. *wink* Something's wrong with your build environment here, even just the "configure" script doesn't work. Can you try to build libxml2 separately to see if that works at all? That being said, Debian has pre-built packages of lxml also for ARM, so it can't be a problem in general. http://packages.debian.org/experimental/python-lxml Stefan
![](https://secure.gravatar.com/avatar/e733d57fce4c55f2eb1adfca8074328b.jpg?s=120&d=mm&r=g)
Stefan Behnel <stefan_ml <at> behnel.de> writes:
It's that long because it's full of errors. *wink*
Something's wrong with your build environment here, even just the "configure" script doesn't work. Can you try to build libxml2 separately to see if that works at all?
That being said, Debian has pre-built packages of lxml also for ARM, so it can't be a problem in general.
http://packages.debian.org/experimental/python-lxml
Stefan
Lol. I error-prone. Unfortunately, i dont use Debian. I have a QNAP TS-112 NAS. I also have libxml2 installed: [/src/pyliball] # ipkg info libxml2 Package: libxml2 Version: 2.7.8-1 Depends: zlib (>=1.2.5) Status: install user installed Section: libs Architecture: arm maintainer: NSLU2 Linux <nslu2-linux@yahoogroups.com> MD5Sum: 5f944cada8ee39362bae6df119f4d681 Size: 913110 Filename: libxml2_2.7.8-1_arm.ipk Source: ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz Description: Libxml2 is the XML C parser and toolkit developed for the Gnome project. This __xmlStructuredErrorContext undefined symbol error i get, is there no work around for this? Is it really required? Can i have it patched or something? What can i do? I'm completely stuck. The app I'm trying to install on my system runs "from lxml import etree" which causes this error.
![](https://secure.gravatar.com/avatar/8b97b5aad24c30e4a1357b38cc39aeaa.jpg?s=120&d=mm&r=g)
L. Dubyzu, 08.11.2012 19:50:
Stefan Behnel <stefan_ml <at> behnel.de> writes:
It's that long because it's full of errors. *wink*
Something's wrong with your build environment here, even just the "configure" script doesn't work. Can you try to build libxml2 separately to see if that works at all?
That being said, Debian has pre-built packages of lxml also for ARM, so it can't be a problem in general.
http://packages.debian.org/experimental/python-lxml
Stefan
Lol. I error-prone. Unfortunately, i dont use Debian. I have a QNAP TS-112 NAS.
Interesting. And you're really compiling code on that machine?
I also have libxml2 installed:
[/src/pyliball] # ipkg info libxml2 Package: libxml2 Version: 2.7.8-1 Depends: zlib (>=1.2.5) Status: install user installed Section: libs Architecture: arm maintainer: NSLU2 Linux <nslu2-linux@yahoogroups.com> MD5Sum: 5f944cada8ee39362bae6df119f4d681 Size: 913110 Filename: libxml2_2.7.8-1_arm.ipk Source: ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz Description: Libxml2 is the XML C parser and toolkit developed for the Gnome project.
This __xmlStructuredErrorContext undefined symbol error i get, is there no work around for this? Is it really required? Can i have it patched or something? What can i do? I'm completely stuck. The app I'm trying to install on my system runs "from lxml import etree" which causes this error.
To build lxml against it, you do not only need the library package itself (i.e. libxml2) but also the development package, i.e. something like libxml2-dev or libxml2-devel. Likewise for libxslt. The missing symbol error means that something that was used during the build doesn't match what is being used at runtime. A build log of your "normal" (non-static) lxml build would help to figure out what went wrong. Stefan
![](https://secure.gravatar.com/avatar/e733d57fce4c55f2eb1adfca8074328b.jpg?s=120&d=mm&r=g)
Stefan Behnel <stefan_ml <at> behnel.de> writes:
To build lxml against it, you do not only need the library package itself (i.e. libxml2) but also the development package, i.e. something like libxml2-dev or libxml2-devel. Likewise for libxslt.
Stefan
Thanks alot Stefan for making it all clear to me. I found this (ftp) site where i can get the development packages. ftp://ftp.xmlsoft.org/libxml2/ I'm using an ARM system, which one will be suitable to install on my system?
![](https://secure.gravatar.com/avatar/8b97b5aad24c30e4a1357b38cc39aeaa.jpg?s=120&d=mm&r=g)
L. Dubyzu, 08.11.2012 03:40:
When i try "from lxml import etree" is give be the following ImportError:
from lxml import etree Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: /share/HDA_DATA/.qpkg/Python/lib/python2.7/site-packages/lxml-3.0.1- py2.7-linux-armv5tel.egg/lxml/etree.so: undefined symbol: __xmlStructuredErrorContext
I've tried downgrading to lxml 3.0, 2.3.6, and 2.3.5 - its the same error. Any suggestions on what needs to be adjusted?
Are you building this on ARM or are you cross compiling? If the latter, please make sure you use the same version of libxml2 and libxslt on both sides. Stefan
participants (3)
-
J. Patrick Narkinsky
-
L. Dubyzu
-
Stefan Behnel