Skip to content Skip to sidebar Skip to footer

"undefined Symbol: __xmlstructurederrorcontext" Importing Etree From Lxml

>>> import lxml >>> from lxml import etree Traceback (most recent call last): File '', line 1, in ImportError: /usr/local/lib/python

Solution 1:

Your version of lxml.etree was compiled against a different version of libxml2 than the one you have actually installed. Reinstalling libxml2 doesn't help because you're just reinstalling the same code. Reinstalling the binaries that bundle your existing etree.cpython-34m.so binary won't work either, because that binary itself is inherently broken (it refers to a symbol that isn't exported in all versions of libxml2).

Uninstall the Python module -- not the C library -- and reinstall it from source. (pip should be able to do this automatically, assuming that you have -devel headers for libxml2 and libxslt installed and an appropriate compiler).

Post a Comment for ""undefined Symbol: __xmlstructurederrorcontext" Importing Etree From Lxml"