(still) cannot install lxml 2.3 for python correctly, but at least 2.2.8 works

  • June 30, 2011 - I reward @Pablo for this question because of his answer. I still cannot install lxml 2.3 correctly for the reasons discussed in its comments. I am going to work a little, but I have already spent a lot of time on this problem. However, I wrote the code I needed and successfully installed lxml 2.2.8. The code works with this version. Even better, Pablo was the only one who correctly diagnosed the error. Which was libxslt, it was necessary to upgrade to a version with exsltMathXpathCtxtRegister support. I appreciate any help on this.

  • June 29, 2011 - An update to this question to reflect comments and in more detail my attempts.


To begin with, I tried all possible solutions and installed a scenario that you can imagine. Yes, there are similar questions with this topic, but their specific problem and solution are not mine. I spent about 10-15 hours on this, and I just keep wondering.

My main concern

In short, after installing lxml-2.3 from the source or with easy_install-2.7 lxml for python2.7 on centOs5.6, an alternative to installing python, I cannot import the module correctly. It will be installed without any obvious error, but when you try to import etree, the following error is returned:

 Python 2.7.2 (default, Jun 16 2011, 11:53:48) [GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2 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: /usr/local/lib/python2.7/site-packages/lxml-2.3-py2.7-linux-x86_64.egg/lxml/etree.so: undefined symbol: exsltMathXpathCtxtRegister 

What i tried

  • The two most common suggestions I came across are to make sure that libxml2 && libxml2-dev and libxslt1 && libxslt1-dev are there. I installed them through yum.

    $ yum list libxslt libxslt-devel libxml2 libxml2-devel Downloaded plugins: Installed packages fastestmirror libxml2.i386
    2.6.26-2.1.2.8.el5_5.1 installed libxml2.x86_64
    2.6.26-2.1.2.8.el5_5.1 installed libxml2-devel.i386
    2.6.26-2.1.2.8.el5_5.1 installed libxml2-devel.x86_64
    2.6.26-2.1.2.8.el5_5.1 installed libxslt.i386
    1.1.17-2.el5_2.2 installed libxslt.x86_64
    1.1.17-2.el5_2.2 installed libxslt-devel.i386
    1.1.17-2.el5_2.2 installed libxslt-devel.x86_64
    1.1.17-2.el5_2.2 installed

  • Reinstalled and confirmed that zlib && zlib-devel installed.

    $ yum list zlib zlib-devel Uploaded plugins: fastestmirror Packages zlib.i386
    1.2.3-3 installed zlib.x86_64
    1.2.3-3 installed zlib-devel.i386
    1.2.3-3 installed zlib-devel.x86_64
    1.2.3-3 installed

  • Installed python-devel . I think.

    a. For some reason, I read a way to check if python-devel is installed on import distutils . regoogling this question quickly brings this one .

    b. @Keith suggested that I tried to β€œinstall” it anyway using this , however I ran into an error

      > error: cannot create %sourcedir /usr/src/redhat/SOURCES 

    so I created a directory and it has been installed ever since. But unsuccessfully.

  • I can, however, import xml.etree.cElementTree as etree and / or import xml.etree.ElementTree as etree , but I need some functionality from lxml.etree

  • Oddly enough, if I try to install lxml under the assumption that dependencies are not installed and try something like the following

    sudo STATIC_DEPS=true easy_install-2.7 lxml 2>&1 | tee -a ~/.lxml

    it crashes with error output below. I should briefly note that for a stranger, this seems to solve a lot of people's problems, as it will come out and get any dependencies and install them to install lxml.

    tail -100 ~/.lxml

    gcc -DHAVE_CONFIG_H -I. -I./include -I./include -D_REENTRANT -I / tmp / easy_install-Y2MKTg / lxml-2.3 / build / tmp / libxml2 / include -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Whar-subscript -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwite-strings -Waggregate -return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs-wininline -decls -c runsuite.c gcc -DHAVE_CONFIG_H -I. -I./include -I./include -D_REENTRANT -I / tmp / easy_install-Y2MKTg / lxml-2.3 / build / tmp / libxml2 / include -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Whar-subscript -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwite-strings -Waggregate -return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs-wininline -decls -c testchar.c testapi.c: In the function "Test_xmlBufferSetAllocationScheme: testapi.c: 18773: warning: comparison of different types of pointers is missing gcc -DHAVE_CONFIG_H -I. -I./include -I./include -D_REENTRANT -I /tmp/easy_install-Y2MKTg/lxml-2.3/build/tmp/libxml2/include -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Whar-subscript -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwite-strings -Waggregate -return -Wstrict-prototypes -Wmissing-pr ototypes -Wnested-externs -Winline -Wredundant-decls -c testdict.c gcc -DHAVE_CONFIG_H -I. -I./include -I./include -D_REENTRANT -I / tmp / easy_install-Y2MKTg / lxml-2.3 / build / tmp / libxml2 / include -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Whar-subscript -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwite-strings -Waggregate -return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs-wininline -decls -c runxmlconf.c gcc -DHAVE_CONFIG_H -I. -I./include -I./include -D_REENTRANT -I / tmp / easy_install-Y2MKTg / lxml-2.3 / build / tmp / libxml2 / include -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Whar-subscript -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwite-strings -Waggregate -return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs-wininline -decls -c testrecurse.c sed -e 'S \ @XML_LIBDIR \ @ - ?? L / TMP / easy_install-Y2MKTg / LXML-2,3 / assembly / TMP / libxml2 / Lib g '\ -e' s? \ @ XML_INCLUDEDIR \ @? - I / tmp / easy_install-Y2MKTg / lxml-2.3 / build / tmp / libxml2 / include / libxml2 -I / tmp / easy_install-Y2MKTg / lxml-2.3 / build / tmp / libxml2 / enable? g "\ -e? \ @ VERSION \ @? 2.7.8? g '\ -e' s? \ @ XML_LIBS \ @? - lxml2 -lz -L / tmp / easy_install-Y2MKTg / lxml-2.3 / build / tmp / libxml2 / lib -liconv -lm? g '\ <./ xml2Conf.sh.in> xml2Conf.tmp \ & && & mv xml2Conf.tmp xml2Conf.sh/bin/sh./libtool --tag = CC --mode = link gcc -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Whar-subscript -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite- strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -module -no- undefined -avoid-version -rpath / tmp / easy_install-Y2MKTg / lxml-2.3 / build / tmp / libxml2 / lib -o testdso.la testdso.lo testapi.c: At the top level: testapi.c: 17989: warning: 'gen_xmlSchematronPtr but not using testapi.c: 17992: warning:' des_xmlSchematronPtr but not using testapi.c: 18009 : warning Resolution: "gen_xmlSchematronParserCtxtPtr but testapi.c is not used: 18012: warning: des_xmlSchematronParserCtxtPtr is not used testapi.c: 34157: warning: gen_xmlSAXHandlerPtr_ptr is not used testapi.cPtr_tr_tr_tr_trp_tr and is not used ar cru.libs / testdso.a testdso.o libtool: link: ranlib.libs / testdso.a libtool: link: (cd ".libs" & rm -f "testdso.la" && ln -s "../testdso .la "" testdso.la ") /bin/sh./Libtool --tag = CC --mode = link gcc -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment - Wtrigraphs -Wformat -Whar-subscript -Wuninitialized -Wparentheses -Wshadow -Wpointer- arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-declsversion info 9: 8: 7 -ldl -o libxml2.la -rpath / tmp / easy _install-Y2MKTg / lxml-2.3 / build / tmp / libxml2 / lib SAX.lo entities.lo encoding.lo error.lo parserInternals.lo parser.lo tree.lo hash.lo list.lo xmlIO.lo xmlmemory .lo uri.lo valid.lo xlink.lo HTMLparser.lo HTMLtree.lo debugXML.lo xpath.lo xpointer.lo xinclude.lo nanohttp.lo nanoftp.lo DOCBparser.lo catalog.lo globals.lo threads.lo c14n.lo xmlstring.lo xmlregexp.lo xmlschemas.lo xmlschemastypes.lo xmlunicode.lo xmlreader.lo relaxng.lo dict.lo SAX2.lo xmlwriter.lo legacy.lo chvalid.lo pattern.lo xmlsave.lo xmlmodule.lo schematron.lo -lz -L / tmp / easy_install-Y2MKTg / lxml-2.3 / build / tmp / libxml2 / lib -liconv -lm libtool: link: ar cru.libs / libxml2.a SAX.o entities.o encoding.o error.o parserInternals. o parser.o tree.o hash.o list.o xmlIO.o xmlmemory.o uri.o valid.o xlink.o HTMLparser.o HTMLtree.o debugXML.o xpath.o xpointer.o xinclude.o nanohttp.o nanoftp .o DOCBparser.o catalog.o globals.o threads.o c14n.o xmlstring.o xmlregexp.o xmlschemas.o xmlschemastypes.o xmlunicode.o xmlreader .o relaxng.o dict.o SAX2.o xmlwriter.o legacy.o chvalid.o pattern.o xmlsave.o xmlmodule.o schematron.o libtool: link: ranlib.libs / libxml2.a libtool: link: (cd " .libs "&& rm -f" libxml2.la "&& & ln -s msgstr" ".. / libtool --tag = CC --mode = link gcc -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit - Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Whar-subscript -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwite-strings -Waggregate -return -Wstrict-prototypes -Wmissing-prototypes -Wnested -tern Winline -Wredundant-decls -o xmllint xmllint.o./libxml2.la -lz -L / tmp / easy_install-Y2MKTg / lxml-2.3 / build / tmp / libxml2 / lib -liconv -lm / bin / sh. / Libtool - -tag = CC --mode = link gcc -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Whar-subscript -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing -protot ypes -Wnested-externs -Winline -Wredundant-decls -o xmlcatalog xmlcatalog.o./libxml2.la -lz -L / tmp / easy_install-Y2MKTg / lxml-2.3 / build / tmp / libxml2 / lib -liconv -lm / bin /sh./libtool --tag = CC --mode = link gcc -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Whar-subscript -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -o testSchemas testSchemas.o./libxml2.la -lz - L / tmp / easy_install-Y2MKTg / lxml-2.3 / build / tmp / libxml2 / lib -liconv -lm / bin / sh. / Libtool --tag = CC --mode = link gcc -g -O2 -pedantic -W - Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Whar-subscript -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmiss prototypes -Wnested-externs -Winline -Wredundant-decls -o testRelax testRelax.o./libxml2.la -lz -L / tmp / easy_install-Y2MKTg / lxml-2.3 / build / tmp / libxml2 / lib -liconv -lm / bin / sh. / libtool --tag = CC --mode = link gcc -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Whar-subscript -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite- strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -o testSAX testSAX.o./libxml2.la -lz -L / tmp / easy_install-Y2MKTg / lxml-2.3 / build / tmp / libxml2 / lib -liconv -lm libtool: link: gcc -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch - Wcomment -Wtrigraphs -Wformat -Whar-subscript -Wuninitialized -Wparentheses - Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls - o testSAX testSAX.o./.libs/libxml2.a - L / TMP / easy_install-Y2MKTg / LXML-2.3 / build / tmp / libxml2 / lib - ldl -lz / tmp / easy_install-Y2MKTg / lxml-2.3 / build / tmp / libxml2 / lib / libiconv.a -lm libtool: link: gcc -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Whar-subscript -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast- align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline-ex -decls -o testRelax testRelax.o. /.libs/libxml2.a -L / tmp / easy_install-Y2MKTg / lxml-2.3 / build / tmp / libxml2 / lib -ldl -lz / tmp / easy_install-Y2MKTg / lxml-2.3 / build / tmp / libxml2 / lib / libiconv.a -lm libtool: link: gcc -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Whar-subscript -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast- align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -o xmlcatalog xmlcatalog.o. /.libs/libxml2.a -L / tmp / easy_install-Y2MKTg / lxml-2.3 / build / tmp / libxml2 / lib -ldl -lz / tmp / easy_install-Y2MKTg / lxml-2.3 / build / tmp / libxml2 / lib / libiconv.a -lm libtool: link: gcc -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Whar-subscript -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast- align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -o testSchemas testSchemas.o. /.libs/libxml2.a -L / tmp / easy_install-Y2MKTg / lxml-2.3 / build / tmp / libxml2 / lib -ldl -lz / tmp / easy_install-Y2MKTg / lxml-2.3 / build / tmp / libxml2 / lib / libiconv.a -lm libtool: link: gcc -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Whar-subscript -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast- align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -o xmllint xmllint.o./.libs/libxml2.a -L / tmp / easy_install -Y2MKTg / lxml-2.3 / build / tmp / libxml2 / lib -ldl -lz / tmp / easy_install-Y2MKTg / lxml-2.3 / build / tmp / libxml2 / lib / libiconv.a -lm./..libs/libxml2. a (/. xmlIO.o): libs In the xmlGzfileOpenW': //tmp/libxml2.aeasy_install-(Y2MKTgxmlIO.o/):lxml -2.3/In build/function tmp/ function xmlGzfileOpenW': //tmp/libxml2.aeasy_install-(Y2MKTgxmlIO.o/):lxml -2.3/In build/function tmp/ libxml2xmlGzfileOpenW-': 2.7.8 // xmlIO .c: tmp1247 /: easy_install -Y2MKTg / lxml-2.3 / build / tmp / undefined libxml2-reference2.7.8 / xmlIO.c: 1247: to undefined `gzopen64 '. /reference.libs/libxml2.a(xmlIO.o): In the function `` XmlGzfileOpen_real ': gzopen64'

    /./tmp./libs/easy_installlibxml2.a-(xmlIO.oY2MKTg):/lxml- In 2.3function / build / tmp / libxml2xmlGzfileOpen_real': -/2.7.8tmp//xmlIO.ceasy_install:1175-Y2MKTg/:lxml- 2.3/build/undefinedtmp /referencelibxml2-2.7.8 /toxmlIO.c : 1175: link gzopen64undefined 'to gzopen64' collect2: collect2: ld returned 1 exit status ld returned 1 exit status make[2]: *** [testRelax] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: *** [testSAX] Error 1 .././.libs/libslibxml2.a/(libxml2.axmlIO.o(xmlIO.o)):: In function In the function xmlGzfileOpenW'xmlGzfileOpenW':: / tmp/easy_install-Y2MKTg//tmp/lxmleasy_install--Y2MKTg/lxml-2.32.3//build/tmp/buildlibxml2-2.7.8//xmlIO.ctmp:/libxml2-1247: undefined reference to 2.7.8gzopen64 / xmlIO.c: 1247: undefined '.reference / .to libs / gzopen64libxml2.a' (./.xmlIO.olibs/libxml2.a(xmlIO.o)): : In Infunction function xmlGzfileOpen_real '': xmlGzfileOpen_real / ': TMP // TMP / easy_install-Y2MKTgeasy_install- / Y2MKTg / LXML-lxml2.3-2.3 // build / TMP / builds / libxml2tmp / libxml2-2.7.82.7.8 / xmlIO.c: / 1175: xmlIO.c: 1175: undefinedundefined reference link to `` gzopen64 'gzopen64'collect2: ld returned 1 output status

    collect2: ld returned 1 exit status. /.libs/libxml2.a(xmlIO.o): To the xmlGzfileOpenW': /tmp/easy_install-Y2MKTg/lxml-2.3/build/tmp/libxml2-2.7.8/xmlIO.c:1247: undefined reference to function xmlGzfileOpenW': /tmp/easy_install-Y2MKTg/lxml-2.3/build/tmp/libxml2-2.7.8/xmlIO.c:1247: undefined reference to gzopen64' . /.libs/libxml2.a(xmlIO.o): To the xmlGzfileOpen_real': /tmp/easy_install-Y2MKTg/lxml-2.3/build/tmp/libxml2-2.7.8/xmlIO.c:1175: undefined reference to function xmlGzfileOpen_real': /tmp/easy_install-Y2MKTg/lxml-2.3/build/tmp/libxml2-2.7.8/xmlIO.c:1175: undefined reference to gzopen64' collect2: ld returned 1 exit status make 2 : * [testSchemas] Error 1 make 2 : [xmlcatalog] Error 1 make 2 : [xmllint] Error 1 make 2 : leave the directory /tmp/easy_install-Y2MKTg/lxml-2.3/build/tmp/libxml2-2.7.8' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory /tmp/easy_install-Y2MKTg/lxml-2.3/build/tmp/libxml2-2.7.8 'make: * [all] Error 2 Traceback (last last call): File "/usr/local/bin/easy_install-2.7", line 8, at load_entry_point (' Setuptools == 0.6c11 ',' console_scripts ',' easy_install -2.7 ') () File "Build / bdist.linux-i686 / egg / Setuptools / commands / easy_install.py", line 1712, in the main file "Build / bdist.linux-i686 / egg / Setu ptools / command / easy_install.py ", line 1700, in the file with_ei_usage" Build / bdist.linux-i686 / egg / Setuptools / command / easy_install.py ", line 1716, in the file" / usr / local / lib / python2. 7 / distutils / core.py ", line 152, in the configuration dist.run_commands () File" /usr/local/lib/python2.7/distutils/dist.py ", line 953, in run_commands self.run_command (cmd) File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run () File "build / bdist.linux-i686 / egg / setuptools / command / easy_install.py" , line 211, in the startup file "Build / bdist.linux-i686 / egg / Setuptools / commands / easy_install.py", line 446, in the easy_install file "Build / bdist.linux-i686 / egg / Setuptools / commands / easy_install. py ", line 476, in the install_item file" Build / bdist.linux-i686 / egg / Setuptools / commands / easy_in stall.py ", line 655, in the install_eggs file" Build / bdist.linux-i686 / egg / Setuptools / commands / easy_install.py ", line 930, in the build_and_install file" Build / bdist.linux-i686 / egg / Setuptools / commands / easy_install.py ", line 919, in the run_setup file" Build / bdist.linux-i686 / egg / Setuptools / sandbox.py ", line 62, in the run_setup file" Build / bdist.linux-i686 / egg / Setuptools / sandbox.py ", line 105, in the startup file" Build / bdist.linux-i686 / egg / Setuptools / sandbox.py ", line 64, in the file" setup.py ", line 130, in
    file "/tmp/easy_install-Y2MKTg/lxml-2.3/setupinfo.py", line 56, in the ext_modules file "/tmp/easy_install-Y2MKTg/lxml-2.3/buildlibxml.py", line 311, in the file build_libxml2xslt "/ tmp /easy_install-Y2MKTg/lxml-2.3/buildlibxml.py ", line 253, in the cmmi file" /tmp/easy_install-Y2MKTg/lxml-2.3/buildlibxml.py ", line 236, in call_subprocess Exception: the command" make -j6 " code 2 is returned

there were significantly more, and if you are interested, you can check it here

I tried several other installation methods. including @agilevic, which returned an error almost identical to the one above. Most others install without much effort, but all do not work from lxml import etree

Why not use yum ? Well, I was able to easily install lxml via yum install python-lxml , but that was the default installation for python2.4 by default. At the moment, it may be easier to reinstall my existing project to work with 2.4. Ultimately, however, I really would like to solve this problem. For myself and for everyone who may face a similar problem in the future.

+6
source share
5 answers

Your libxslt does not have exsltMathXpathCtxtRegister uninstall it and manually install a newer version (1.1.26 should work fine).

An older version of lxml may work too, try with easy_install lxml==2.2.8

+2
source

A word to future googlers - I came here with the same symptom, but the latest packaged version of libxslt (1.1.26) was installed quite well. 10 minutes before I understood, I also had an ancient version on my way (installed with the casapy astronomy casapy ).

Moral of the story: run locate libxslt to find old versions, and check the $LD_LIBRARY_PATH flag! (Of course, this applies to any library conflict in general).

+2
source

Reading your output, it looks like the linker is undefined reference to gzopen64 error: undefined reference to gzopen64

This error started in lxml-2.3/buildlibxml.py", line 236, in call_subprocess , which reappeared in make -j6

I found this thread here: http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=15524 , which had the same compiler error. With an offer

You can install the zlib i586 delegate library version. You may need to install the 64-bit version of zlib and zlib-devel.

And the OP of this thread later commented:

Now I downloaded the source from zlib and compiled it into the local environment. / usr / local / includes such. recompiled all plugins and again compiled ImageMagick.

Now it works. Thank you so much: D

So, I would suggest reinstalling zlib and zlib-devel, and then try installing lxml again.

+1
source

It is best to compile LibXML2 and LibXSLT from sources. Assuming the prefix for your installation should be the same as your custom Python, which looks like / usr / local, here (like, for example, there might be a newer version of the software, check this):

 wget http://xmlsoft.org/sources/libxml2-sources-2.7.7.tar.gz gzip -dc libxml2-sources-2.7.7.tar.gz | tar xvf - cd libxml2-2.7.7 ./configure --prefix=/usr/local make make install wget http://xmlsoft.org/sources/libxslt-1.1.26.tar.gz gzip -dc libxslt-1.1.26.tar.gz | tar xvf - cd libxslt-1.1.26 ./configure --prefix=/usr/local make make install 

If the above does not compile, there may be other dependencies that you should try to satisfy from yum packages, usually these were specific libraries and / or * -devel packages with missing header files.

After that either

 easy_install lxml 

or

 pip install lxml 
0
source

Make sure libxslt-dev and libxml2-dev are installed on your computer (you can do it with yum, I think); lxml will not build without them.

-1
source

Source: https://habr.com/ru/post/890962/


All Articles