如何为 PyPy 安装 lxml?

How to install lxml for PyPy?

我已经为 PyPy 创建了一个虚拟环境:

virtualenv test -p `which pypy`
source test/bin/activate

我安装了以下依赖项:

sudo apt-get install python-dev libxml2 libxml2-dev libxslt-dev

然后我运行:

pip install --upgrade pypy

因此,我收到很多错误,如下所示:

src/lxml/lxml.etree.c:234038:22: error: `PyThreadState` {aka struct _ts}` has no member named `use_tracing`

如何为 PyPy 2.6.0 正确安装 lxml?

我为 PyPy 使用了以下 lxml 分支:

https://github.com/aglyzov/lxml/tree/cffi

可以安装:

pip install -e git+git://github.com/aglyzov/lxml.git@cffi#egg=lxml-cffi