5

I receive these errors on installing lxml via pip:

 running build_ext building 'lxml.etree' extension creating build/temp.linux-i686-3.5 creating build/temp.linux-i686-3.5/src creating build/temp.linux-i686-3.5/src/lxml gcc -pthread -fno-strict-aliasing -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/libxml2 -Isrc/lxml/includes -I/usr/local/include/python3.5m -c src/lxml/lxml.etree.c -o build/temp.linux-i686-3.5/src/lxml/lxml.etree.o -w In file included from src/lxml/lxml.etree.c:321: src/lxml/includes/etree_defs.h:19:4: error: #error minimum required version of libxml2 is 2.7.0 src/lxml/includes/etree_defs.h:28:4: error: #error minimum required version of libxslt is 1.1.23 src/lxml/lxml.etree.c: In function ‘__pyx_pf_4lxml_5etree_9XMLParser___init__’: src/lxml/lxml.etree.c:113201: error: ‘XML_PARSE_HUGE’ undeclared (first use in this function) src/lxml/lxml.etree.c:113201: error: (Each undeclared identifier is reported only once src/lxml/lxml.etree.c:113201: error: for each function it appears in.) src/lxml/lxml.etree.c: In function ‘__pyx_pf_4lxml_5etree_10Schematron_6__call__’: src/lxml/lxml.etree.c:194047: error: ‘XML_SCHEMATRON_OUT_ERROR’ undeclared (first use in this function) Compile failed: command 'gcc' failed with exit status 1 creating tmp cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c /tmp/xmlXPathInitomumkupc.c -o tmp/xmlXPathInitomumkupc.o cc tmp/xmlXPathInitomumkupc.o -L/usr/lib -lxml2 -o a.out error: command 'gcc' failed with exit status 1 ---------------------------------------- Command "/usr/local/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-2c9_3zz2/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-du99fdnt-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-2c9_3zz2/lxml/ 

Assuming some packages aren't meeting the requirement, I tried updating them via yum:

Package libxml2-2.6.26-2.1.25.el5_11.i386 already installed and latest version

Package libxslt-1.1.17-4.el5_8.3.i386 already installed and latest version

I am on CentOS with Python 3.5.1. Is there no straight forward way to have this installed?

Perhaps it's worth seeking out another yum repo?

If I try a manual install (libxslt 1.1.23 and libxml 2-2.7.2) via https://serverfault.com/questions/266927/install-libxml2-2-7-x-on-centos-5-x#305682 of these two packages to get them up-to-date, I get this error when trying to use lxml in Python 3.5:

>>> from lxml import html Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.5/site-packages/lxml/html/__init__.py", line 54, in <module> from .. import etree ImportError: /usr/local/lib/python3.5/site-packages/lxml/etree.cpython-35m-i386-linux-gnu.so: undefined symbol: xmlMemDisplayLast 
9
  • 2
    What about libxslt? That's the other lib you should have installed. Commented Nov 23, 2016 at 1:05
  • 1
    @schwobaseggl Yeah that's installed already Package libxslt-1.1.17-4.el5_8.3.i386 already installed and latest version Commented Nov 23, 2016 at 2:04
  • 1
    Given that messages error minimum required version of libxml2 is 2.7.0 and error minimum required version of libxslt is 1.1.23, are you saying your problem is that you don't know how to get packages that satisfy these requirements installed on CENTOS? Does this help: serverfault.com/questions/266927/…? Commented Jan 14, 2017 at 11:05
  • @snakecharmerb I've tried manual installs only to be met with more errors, I'll add it into the question Commented Jan 14, 2017 at 18:57
  • So it looks like lxml now builds, but somehow has not compiled correctly. Can you tell us: what versions of libxml2 and libxslt you have installed? What versions of libxml2-devel and libxslt-devel you have installed? What version of lxml did you install? Commented Jan 14, 2017 at 22:32

1 Answer 1

1
src/lxml/includes/etree_defs.h:19:4: error: #error minimum required version of libxml2 is 2.7.0 src/lxml/includes/etree_defs.h:28:4: error: #error minimum required version of libxslt is 1.1.23 

The version of libxml2-devel & libxslt-devel are not satisfied requirements.

try yum install libxml2-devel libxslt-devel

Sign up to request clarification or add additional context in comments.

1 Comment

Assuming some packages aren't meeting the requirement, I tried updating them via yum, followed by package versions that are too old. They need help finding newer packages.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.