0

I am trying to get python-pptx installed for Python 3 on a server machine (Red Hat 4.1.2-52). I'm having some trouble installing its dependency, lxml. I've tried to install all of the dependencies separately (as suggested here).

# sudo yum install -y gcc libxml2 libxml2-devel libxslt libxslt-devel python-devel
Setting up Install Process
Package gcc-4.1.2-55.el5.x86_64 already installed and latest version
Package libxml2-2.6.26-2.1.25.0.1.el5_11.x86_64 already installed and latest version
Package libxml2-2.6.26-2.1.25.0.1.el5_11.i386 already installed and latest version
Package libxml2-devel-2.6.26-2.1.25.0.1.el5_11.x86_64 already installed and latest version
Package libxml2-devel-2.6.26-2.1.25.0.1.el5_11.i386 already installed and latest version
Package libxslt-1.1.17-4.0.1.el5_8.3.x86_64 already installed and latest version
Package libxslt-1.1.17-4.0.1.el5_8.3.i386 already installed and latest version
Package libxslt-devel-1.1.17-4.0.1.el5_8.3.x86_64 already installed and latest version
Package libxslt-devel-1.1.17-4.0.1.el5_8.3.i386 already installed and latest version
Package python-devel-2.4.3-56.el5.x86_64 already installed and latest version
Package python-devel-2.4.3-56.el5.i386 already installed and latest version
Nothing to do

Here's the full traceback from # pip install lxml.

Downloading/unpacking lxml
  Downloading lxml-3.4.4.tar.gz (3.5MB): 3.5MB downloaded
  Running setup.py (path:/tmp/pip_build_root/lxml/setup.py) egg_info for package lxml
    Building lxml version 3.4.4.
    Building without Cython.
    Using build configuration of libxslt 1.1.17
    Minimum required version of libxslt is 1.1.17, found 1.1.23
    Building against libxml2/libxslt in the following directory: /usr/lib64
    /usr/local/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'bugtrack_url'
      warnings.warn(msg)

    warning: no previously-included files found matching '*.py'
Installing collected packages: lxml
  Running setup.py install for lxml
    Building lxml version 3.4.4.
    Building without Cython.
    Using build configuration of libxslt 1.1.17
    Minimum required version of libxslt is 1.1.17, found 1.1.23
    Building against libxml2/libxslt in the following directory: /usr/lib64
    building 'lxml.etree' extension
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/libxml2 -I/tmp/pip_build_root/lxml/src/lxml/includes -I/usr/local/include/python3.4m -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-3.4/src/lxml/lxml.etree.o -w
    In file included from src/lxml/lxml.etree.c:239:
    /tmp/pip_build_root/lxml/src/lxml/includes/etree_defs.h:19:4: error: #error minimum required version of libxml2 is 2.7.0
    /tmp/pip_build_root/lxml/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:103187: error: ‘XML_PARSE_HUGE’ undeclared (first use in this function)
    src/lxml/lxml.etree.c:103187: error: (Each undeclared identifier is reported only once
    src/lxml/lxml.etree.c:103187: 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:177038: error: ‘XML_SCHEMATRON_OUT_ERROR’ undeclared (first use in this function)
    /usr/local/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'bugtrack_url'
      warnings.warn(msg)
    error: command 'gcc' failed with exit status 1
    Complete output from command /usr/local/bin/python3.4 -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-mrgef1x6-record/install-record.txt --single-version-externally-managed --compile:
    Building lxml version 3.4.4.

Building without Cython.

Using build configuration of libxslt 1.1.17

Minimum required version of libxslt is 1.1.17, found 1.1.23

Building against libxml2/libxslt in the following directory: /usr/lib64

running install

running build

running build_py

creating build

creating build/lib.linux-x86_64-3.4

creating build/lib.linux-x86_64-3.4/lxml

copying src/lxml/builder.py -> build/lib.linux-x86_64-3.4/lxml

copying src/lxml/pyclasslookup.py -> build/lib.linux-x86_64-3.4/lxml

copying src/lxml/ElementInclude.py -> build/lib.linux-x86_64-3.4/lxml

copying src/lxml/doctestcompare.py -> build/lib.linux-x86_64-3.4/lxml

copying src/lxml/__init__.py -> build/lib.linux-x86_64-3.4/lxml

copying src/lxml/usedoctest.py -> build/lib.linux-x86_64-3.4/lxml

copying src/lxml/_elementpath.py -> build/lib.linux-x86_64-3.4/lxml

copying src/lxml/cssselect.py -> build/lib.linux-x86_64-3.4/lxml

copying src/lxml/sax.py -> build/lib.linux-x86_64-3.4/lxml

creating build/lib.linux-x86_64-3.4/lxml/includes

copying src/lxml/includes/__init__.py -> build/lib.linux-x86_64-3.4/lxml/includes

creating build/lib.linux-x86_64-3.4/lxml/html

copying src/lxml/html/html5parser.py -> build/lib.linux-x86_64-3.4/lxml/html

copying src/lxml/html/soupparser.py -> build/lib.linux-x86_64-3.4/lxml/html

copying src/lxml/html/builder.py -> build/lib.linux-x86_64-3.4/lxml/html

copying src/lxml/html/ElementSoup.py -> build/lib.linux-x86_64-3.4/lxml/html

copying src/lxml/html/_setmixin.py -> build/lib.linux-x86_64-3.4/lxml/html

copying src/lxml/html/defs.py -> build/lib.linux-x86_64-3.4/lxml/html

copying src/lxml/html/diff.py -> build/lib.linux-x86_64-3.4/lxml/html

copying src/lxml/html/_diffcommand.py -> build/lib.linux-x86_64-3.4/lxml/html

copying src/lxml/html/formfill.py -> build/lib.linux-x86_64-3.4/lxml/html

copying src/lxml/html/__init__.py -> build/lib.linux-x86_64-3.4/lxml/html

copying src/lxml/html/usedoctest.py -> build/lib.linux-x86_64-3.4/lxml/html

copying src/lxml/html/clean.py -> build/lib.linux-x86_64-3.4/lxml/html

copying src/lxml/html/_html5builder.py -> build/lib.linux-x86_64-3.4/lxml/html

creating build/lib.linux-x86_64-3.4/lxml/isoschematron

copying src/lxml/isoschematron/__init__.py -> build/lib.linux-x86_64-3.4/lxml/isoschematron

copying src/lxml/lxml.etree.h -> build/lib.linux-x86_64-3.4/lxml

copying src/lxml/lxml.etree_api.h -> build/lib.linux-x86_64-3.4/lxml

copying src/lxml/includes/c14n.pxd -> build/lib.linux-x86_64-3.4/lxml/includes

copying src/lxml/includes/xinclude.pxd -> build/lib.linux-x86_64-3.4/lxml/includes

copying src/lxml/includes/dtdvalid.pxd -> build/lib.linux-x86_64-3.4/lxml/includes

copying src/lxml/includes/xmlerror.pxd -> build/lib.linux-x86_64-3.4/lxml/includes

copying src/lxml/includes/xmlschema.pxd -> build/lib.linux-x86_64-3.4/lxml/includes

copying src/lxml/includes/etreepublic.pxd -> build/lib.linux-x86_64-3.4/lxml/includes

copying src/lxml/includes/xpath.pxd -> build/lib.linux-x86_64-3.4/lxml/includes

copying src/lxml/includes/uri.pxd -> build/lib.linux-x86_64-3.4/lxml/includes

copying src/lxml/includes/xmlparser.pxd -> build/lib.linux-x86_64-3.4/lxml/includes

copying src/lxml/includes/schematron.pxd -> build/lib.linux-x86_64-3.4/lxml/includes

copying src/lxml/includes/tree.pxd -> build/lib.linux-x86_64-3.4/lxml/includes

copying src/lxml/includes/xslt.pxd -> build/lib.linux-x86_64-3.4/lxml/includes

copying src/lxml/includes/htmlparser.pxd -> build/lib.linux-x86_64-3.4/lxml/includes

copying src/lxml/includes/config.pxd -> build/lib.linux-x86_64-3.4/lxml/includes

copying src/lxml/includes/relaxng.pxd -> build/lib.linux-x86_64-3.4/lxml/includes

copying src/lxml/includes/etree_defs.h -> build/lib.linux-x86_64-3.4/lxml/includes

copying src/lxml/includes/lxml-version.h -> build/lib.linux-x86_64-3.4/lxml/includes

creating build/lib.linux-x86_64-3.4/lxml/isoschematron/resources

creating build/lib.linux-x86_64-3.4/lxml/isoschematron/resources/rng

copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.linux-x86_64-3.4/lxml/isoschematron/resources/rng

creating build/lib.linux-x86_64-3.4/lxml/isoschematron/resources/xsl

copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.linux-x86_64-3.4/lxml/isoschematron/resources/xsl

copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.linux-x86_64-3.4/lxml/isoschematron/resources/xsl

creating build/lib.linux-x86_64-3.4/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.linux-x86_64-3.4/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.linux-x86_64-3.4/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.linux-x86_64-3.4/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.linux-x86_64-3.4/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.linux-x86_64-3.4/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.linux-x86_64-3.4/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

running build_ext

building 'lxml.etree' extension

creating build/temp.linux-x86_64-3.4

creating build/temp.linux-x86_64-3.4/src

creating build/temp.linux-x86_64-3.4/src/lxml

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/libxml2 -I/tmp/pip_build_root/lxml/src/lxml/includes -I/usr/local/include/python3.4m -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-3.4/src/lxml/lxml.etree.o -w

In file included from src/lxml/lxml.etree.c:239:

/tmp/pip_build_root/lxml/src/lxml/includes/etree_defs.h:19:4: error: #error minimum required version of libxml2 is 2.7.0

/tmp/pip_build_root/lxml/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:103187: error: ‘XML_PARSE_HUGE’ undeclared (first use in this function)

src/lxml/lxml.etree.c:103187: error: (Each undeclared identifier is reported only once

src/lxml/lxml.etree.c:103187: 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:177038: error: ‘XML_SCHEMATRON_OUT_ERROR’ undeclared (first use in this function)

/usr/local/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'bugtrack_url'

  warnings.warn(msg)

error: command 'gcc' failed with exit status 1

Any ideas what I might be doing wrong? Thanks very much in advance!

If anything, this is a duplicate of this post which also went unanswered...but we got slightly different error messages.

Community
  • 1
  • 1
Static Void
  • 568
  • 3
  • 8
  • possible duplicate of [pip install lxml error](http://stackoverflow.com/questions/5178416/pip-install-lxml-error) – Stedy Sep 15 '15 at 02:52
  • I am aware of that thread and I believe that I've attempted all of the suggested fixes there... – Static Void Sep 15 '15 at 13:31

2 Answers2

0

I don't use Red Hat, but my recommendation for you is to follow the instructions from here:

sudo yum install make automake gcc gcc-c++ kernel-devel git-core -y 

sudo yum install python-devel -y 

sudo curl -o /tmp/ez_setup.py https://sources.rhodecode.com/setuptools/raw/bootstrap/ez_setup.py 

sudo /usr/bin/python /tmp/ez_setup.py 

sudo /usr/bin/easy_install pip 

sudo rm setuptools-*.tar.gz 

sudo pip install -i https://pypi.rhodecode.com/ --upgrade pip 

sudo pip install virtualenv 

The idea here is that you would install a virtual environment and work with pip packages under it, which is easy and more reliable in terms of dependencies.

SuperBiasedMan
  • 9,814
  • 10
  • 45
  • 73
Ricardo Silveira
  • 1,193
  • 1
  • 8
  • 16
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – Wtower Sep 15 '15 at 06:54
  • @Wtower, I agree with what you mentioned. I will edit the answer. And for kenorb, I thought StackOverFlow was about helping instead of nagging. – Ricardo Silveira Sep 15 '15 at 10:13
  • @RicardoSilveira Thanks. I'll give it a shot in a virtualenv and report back. – Static Void Sep 15 '15 at 13:34
  • @RicardoSilveira No luck. I get the same gcc error. – Static Void Sep 18 '15 at 21:43
0

Please don't use sources.rhodecode.com and pypi.rhodecode.com they will soon disappear :) We're no longer mirror our python stuff internally at RhodeCode.

marcinkuzminski
  • 1,751
  • 14
  • 11