lxml not working against python 3.2.3 ?
![](https://secure.gravatar.com/avatar/b62f729bed5ab5ca7b1283da01679082.jpg?s=120&d=mm&r=g)
hi All, i've installed lxml using pip for python3, but when i try to: "from lxml import etree", it failed with an exslt symbol not found: : [lab146]# p3 : Python 3.2.3 (default, Nov 21 2012, 18:28:16) : [GCC 4.5.2] on sunos5 : Type "help", "copyright", "credits" or "license" for more information. : >>> import lxml : >>> from lxml import etree : Traceback (most recent call last): : File "<stdin>", line 1, in <module> : ImportError: ld.so.1: python3: fatal: relocation error: file /usr/local/lib/python3.2/site-packages/lxml/etree.so: symbol exsltStrXpathCtxtRegister: referenced symbol not found : [lab146]# lsf /usr/lib/*xslt* : /usr/lib/libexslt.so@ /usr/lib/libxslt.so@ /usr/lib/llib-lexslt /usr/lib/llib-lxslt : /usr/lib/libexslt.so.0* /usr/lib/libxslt.so.1* /usr/lib/llib-lexslt.ln /usr/lib/llib-lxslt.ln : [lab146]# ll /usr/lib/*xslt* : lrwxrwxrwx 1 root root 15 Oct 15 16:22 /usr/lib/libexslt.so -> ./libexslt.so.0 : -r-xr-xr-x 1 root bin 134792 Oct 15 16:22 /usr/lib/libexslt.so.0 : lrwxrwxrwx 1 root root 14 Oct 15 16:22 /usr/lib/libxslt.so -> ./libxslt.so.1 : -r-xr-xr-x 1 root bin 346644 Oct 15 16:22 /usr/lib/libxslt.so.1 : -r--r--r-- 1 root bin 487 Oct 15 16:22 /usr/lib/llib-lexslt : -r--r--r-- 1 root bin 135186 Oct 15 16:22 /usr/lib/llib-lexslt.ln : -r--r--r-- 1 root bin 487 Oct 15 16:22 /usr/lib/llib-lxslt : -r--r--r-- 1 root bin 185413 Oct 15 16:22 /usr/lib/llib-lxslt.ln : [lab146]# : [lab146]# echo $LD_LIBRARY_PATH : /lib:/usr/lib:/usr/lib/openssl:/usr/X11/lib:/usr/sfw/lib:/usr/local/ssl/lib:/usr/local/lib:/usr/local/instantclient_11_2/32/lib : [lab146]# the "pip" install output showed that the etree.so was indeed linked against the libs ... : gcc -shared build/temp.solaris-2.11-i86pc.32bit-3.2/src/lxml/lxml.etree.o -L/usr/lib -lxslt -lexslt -lxml2 -lz : -lm -o build/lib.solaris-2.11-i86pc.32bit-3.2/lxml/etree.so are there some steps that i'm missing ... the python2 that was bundled with the system, works: : [lab146]# p2 : Python 2.6.4 (r264:75706, Oct 17 2011, 16:55:05) [C] on sunos5 : Type "help", "copyright", "credits" or "license" for more information. : >>> from lxml import etree : >>> : : [lab146]# pldd 21862 : 21862: python : /usr/lib/libc/libc_hwcap1.so.1 : /usr/lib/libpython2.6.so.1.0 : /lib/libdl.so.1 : /usr/lib/python2.6/lib-dynload/readline.so : /usr/lib/libreadline.so.5 : /lib/libm.so.2 : /usr/local/lib/libncurses.so.5.7 : /usr/local/lib/libintl.so.8.1.1 : /usr/gcc/4.5/lib/libgcc_s.so.1 : /usr/local/lib/libiconv.so.2.5.1 : /usr/lib/python2.6/vendor-packages/lxml/etree.so : /usr/lib/libxslt.so.1 : /usr/lib/libexslt.so.0 : /lib/libxml2.so.2 : /lib/libz.so.1 : /lib/libpthread.so.1 : /lib/libsocket.so.1 : /lib/libnsl.so.1 : /lib/libmd.so.1 : /lib/libmp.so.2 : /usr/lib/python2.6/lib-dynload/_fileio.so : /usr/lib/python2.6/lib-dynload/_functools.so : /usr/lib/python2.6/lib-dynload/time.so : /usr/lib/python2.6/lib-dynload/_collections.so : /usr/lib/python2.6/lib-dynload/operator.so : /usr/lib/python2.6/lib-dynload/_bytesio.so : /usr/lib/python2.6/lib-dynload/strop.so : [lab146]# thanks in advance for all help, cheers, sam
![](https://secure.gravatar.com/avatar/8b97b5aad24c30e4a1357b38cc39aeaa.jpg?s=120&d=mm&r=g)
Hi, sang-suan gam, 22.11.2012 05:17:
i've installed lxml using pip for python3, but when i try to: "from lxml import etree", it failed with an exslt symbol not found:
: [lab146]# p3 : Python 3.2.3 (default, Nov 21 2012, 18:28:16) : [GCC 4.5.2] on sunos5 : Type "help", "copyright", "credits" or "license" for more information. : >>> import lxml : >>> from lxml import etree : Traceback (most recent call last): : File "<stdin>", line 1, in <module> : ImportError: ld.so.1: python3: fatal: relocation error: file /usr/local/lib/python3.2/site-packages/lxml/etree.so: symbol exsltStrXpathCtxtRegister: referenced symbol not found
: [lab146]# lsf /usr/lib/*xslt* : /usr/lib/libexslt.so@ /usr/lib/libxslt.so@ /usr/lib/llib-lexslt /usr/lib/llib-lxslt : /usr/lib/libexslt.so.0* /usr/lib/libxslt.so.1* /usr/lib/llib-lexslt.ln /usr/lib/llib-lxslt.ln : [lab146]# ll /usr/lib/*xslt* : lrwxrwxrwx 1 root root 15 Oct 15 16:22 /usr/lib/libexslt.so -> ./libexslt.so.0 : -r-xr-xr-x 1 root bin 134792 Oct 15 16:22 /usr/lib/libexslt.so.0 : lrwxrwxrwx 1 root root 14 Oct 15 16:22 /usr/lib/libxslt.so -> ./libxslt.so.1 : -r-xr-xr-x 1 root bin 346644 Oct 15 16:22 /usr/lib/libxslt.so.1 : -r--r--r-- 1 root bin 487 Oct 15 16:22 /usr/lib/llib-lexslt : -r--r--r-- 1 root bin 135186 Oct 15 16:22 /usr/lib/llib-lexslt.ln : -r--r--r-- 1 root bin 487 Oct 15 16:22 /usr/lib/llib-lxslt : -r--r--r-- 1 root bin 185413 Oct 15 16:22 /usr/lib/llib-lxslt.ln : [lab146]# : [lab146]# echo $LD_LIBRARY_PATH : /lib:/usr/lib:/usr/lib/openssl:/usr/X11/lib:/usr/sfw/lib:/usr/local/ssl/lib:/usr/local/lib:/usr/local/instantclient_11_2/32/lib : [lab146]#
the "pip" install output showed that the etree.so was indeed linked against the libs ...
: gcc -shared build/temp.solaris-2.11-i86pc.32bit-3.2/src/lxml/lxml.etree.o -L/usr/lib -lxslt -lexslt -lxml2 -lz : -lm -o build/lib.solaris-2.11-i86pc.32bit-3.2/lxml/etree.so
are there some steps that i'm missing ...
the python2 that was bundled with the system, works:
: [lab146]# p2 : Python 2.6.4 (r264:75706, Oct 17 2011, 16:55:05) [C] on sunos5 : Type "help", "copyright", "credits" or "license" for more information. : >>> from lxml import etree : >>> : : [lab146]# pldd 21862 : 21862: python : /usr/lib/libc/libc_hwcap1.so.1 : /usr/lib/libpython2.6.so.1.0 : /lib/libdl.so.1 : /usr/lib/python2.6/lib-dynload/readline.so : /usr/lib/libreadline.so.5 : /lib/libm.so.2 : /usr/local/lib/libncurses.so.5.7 : /usr/local/lib/libintl.so.8.1.1 : /usr/gcc/4.5/lib/libgcc_s.so.1 : /usr/local/lib/libiconv.so.2.5.1 : /usr/lib/python2.6/vendor-packages/lxml/etree.so : /usr/lib/libxslt.so.1 : /usr/lib/libexslt.so.0 : /lib/libxml2.so.2 : /lib/libz.so.1 : /lib/libpthread.so.1 : /lib/libsocket.so.1 : /lib/libnsl.so.1 : /lib/libmd.so.1 : /lib/libmp.so.2 : /usr/lib/python2.6/lib-dynload/_fileio.so : /usr/lib/python2.6/lib-dynload/_functools.so : /usr/lib/python2.6/lib-dynload/time.so : /usr/lib/python2.6/lib-dynload/_collections.so : /usr/lib/python2.6/lib-dynload/operator.so : /usr/lib/python2.6/lib-dynload/_bytesio.so : /usr/lib/python2.6/lib-dynload/strop.so : [lab146]#
This doesn't look Py3.x specific in any way, so I changed the subject line. I think the problem is that you are building it yourself, independent of any specific Python version. Which version of libxslt are you using? (The Py2.7 lxml can tell you that). Do you have more than one library version installed? Did you get any compiler warnings during the build? Are you sure the development package of libxslt is properly installed? Stefan
participants (2)
-
sang-suan gam
-
Stefan Behnel