1. Pypy
  2. Untitled project
  3. compatibility

Wiki

Clone wiki

compatibility / lxml

lxml

For PyPy >= 5.1

You need to:

  • make sure Cython is installed: pip install cython
  • install latest version normally: pip install lxml

If you get an error like libxml/xmlversion.h: No such file or directory

try adding an extra include path using CFLAGS:

CFLAGS=-I/usr/include/libxml2 pip install lxml

Note that building lxml requires libxml2, libxslt and zlib headers (on Ubuntu, apt-get install zlib1g-dev libxslt1-dev libxml2-dev).

For PyPy trunk (or >= 4.1)

You need to:

  • make sure Cython is installed: pip install cython

For PyPy up to 4.0.1

lxml doesn't quite work on this PyPy, but you can give it a try anyway.

  • make sure Cython is installed: pip install cython
  • grab the source, for example with pip install -I --build=/tmp/build --no-install --upgrade lxml
  • then cd /tmp/build/lxml and manually delete two files: rm src/lxml/lxml.etree.c and rm src/lxml/lxml.objectify.c to force Cython to regenerate them
  • then python setup.py build and python setup.py install

lxml has also been forked and wrapped with cffi. While this fork does pass the full lxml test suite, it is only current with lxml 3.4.0 and is not likely to get future updates. See https://github.com/lxml-cffi/lxml-cffi.


Category:Parsers and parser generators
Compatible:Compatible

Updated