lxml 这个东西比较奇怪,在 ubuntu 上装了了几次,最近终于把它装上了。
要按照官方的安装说明来做:
http://codespeak.net/lxml/installation.html
不然总是出现gcc编译的问题。
当然首先要有 Python :You need Python 2.3 or later.
然后是需要:You need libxml2 and libxslt, in particular:
使用:$sudo apt-get install libxml2 libxml2-dev 安装 libxml2
使用:$sudo apt-get install libxlst1 libxslt1-dev 安装 libxslt
安装 python-libxml2 和 python-libxslt1 :$sudo apt-get install python-libxml2 python-libxslt1
然后就可以使用:$sudo easy_install lxml 来安装最新的 lxml 了。我装的是最新版本:lxml 2.2beta1
在 Cygwin 上安装也一样,直接选择安装 libxml2, libxml2-devel, libxlst, libxlst-devel, python-libxml2, python-libxslt 包安装,
然后 $sudo easy_install lxml 就可以装上了。
---------------------------------------------------------------------------------------
2009,02,28
刚发布不久的 zope 3.4.0 里 lxml 似乎回到了 1.3.6 。
详细页面: http://download.zope.org/zope3.4/
其中 lxml 相关说明:
lxml
1.3.6 (2007-10-29)
Bugs fixed
- Backported decref crash fix from 2.0
- Well hidden free-while-in-use crash bug in ObjectPath
Other changes
- The test suites now run gc.collect() in the tearDown() methods. While this makes them take a lot longer to run, it also makes it easier to link a specific test to garbage collection problems that would otherwise appear in later tests.
=======================
2009,04,03
1.其实不需要安装 python-libxml2 和 python-libxslt1
2.注意 ubuntu 源中 libxslt1 现在由 libxslt1.1 替代了。
3.最后的总结:只需要把 libxml2 和 libxslt 的开发包装上即可。
easy_install 或者直接 buildout 的时候在第一次安装 lxml 时会花些时间。