准备工作:
1.确认python-dev,cython(可不安装),easy_install都已安装好(安装方法见: )。
2.安装
- libxml 2.6.21 or later. It can be found here: http://xmlsoft.org/downloads.html
If you want to use XPath, do not use libxml2 2.6.27. We recommend libxml2 2.7.3, 2.7.7 or later. - libxslt 1.1.15 or later. It can be found here: http://xmlsoft.org/XSLT/downloads.html
3.安装lxml
操作如下:
#!/bin/bash
sudo apt-get install libxml2-dev
sudo apt-get install libxslt1-dev
easy_install lxml
参考:http://codespeak.net/lxml/installation.html