0

I am installing odoo system in a virtual environment. I had problems installing lxml module.

I am using "pip --trusted-host pypi.python.org install lxml" command, but I receive an error. I have tried to download the sources, but the same error occurs. I am using Python 2.7.9 under Linux:

(odoo)odoo@des [~]# python -V
Python 2.7.9
(odoo)odoo@des [~]# uname -a
Linux des.desytec.com 2.6.32-042stab104.1 #1 SMP Thu Jan 29 12:58:41 MSK 2015 x86_64 x86_64 x86_64 GNU/Linux

I have read a lot of pages telling about this problem. Some say that it is a memory problem and others say that libxml is missing. Both cases don't apply to me. What else could be?

Collecting lxml
  Downloading lxml-3.4.2.tar.gz (3.5MB)
    /usr/local/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
      warnings.warn(msg)
    Building lxml version 3.4.2.
    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
Installing collected packages: lxml
  Running setup.py install for lxml
    /usr/local/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
      warnings.warn(msg)
    Building lxml version 3.4.2.
    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 -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/libxml2 -I/tmp/pip-build-idzRLz/lxml/src/lxml/inclu$
    In file included from src/lxml/lxml.etree.c:239:
    /tmp/pip-build-idzRLz/lxml/src/lxml/includes/etree_defs.h:19:4: error: #error minimum required version of libxml2 is 2.7.0
    /tmp/pip-build-idzRLz/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:103123: error: ‘XML_PARSE_HUGE’ undeclared (first use in this function)
    src/lxml/lxml.etree.c:103123: error: (Each undeclared identifier is reported only once
    src/lxml/lxml.etree.c:103123: 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:176893: error: ‘XML_SCHEMATRON_OUT_ERROR’ undeclared (first use in this function)
    error: command 'gcc' failed with exit status 1
    Complete output from command /home/odoo/odoo/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip-build-idzRLz/lxml/setup.py';exec(compile(getattr(toke$
    /usr/local/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'

      warnings.warn(msg)

    Building lxml version 3.4.2.

    Building without Cython.
jstuardo
  • 3,901
  • 14
  • 61
  • 136

2 Answers2

1

I had a similar problem. Everything was decided by setting several libraries

sudo apt-get install libxslt1-dev libxml2-dev

Solution has been found thanks one and second

0

From the Installing lxml you can see that the latest lxml requires libxml2 version 2.7.0 or later and libxslt version 1.1.23 or later, which haven't been installed on your system.

you can:

  • Update your libxslt, e.x. download rpm here

  • If there isn't a right version supporting for your system(like CentOS 5), you can choose an order version like lxml 2.2.2 which is also suitable for lots of situations.

XytHu
  • 1