我桌面上的 CentOS 6.4 已经安装了 python 2.6.6
$ which python
/usr/bin/python
$ python
Python 2.6.6 (r266:84292, Feb 22 2013, 00:00:18)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
我将 python 3.3.0 从源并排安装到现有的 python 2.6.6 版本。
但是,当我尝试在 python 3 中使用 lxml 模块时,我得到如下 ImportError :
$ which python3
/usr/local/bin/python3
$ python3
Python 3.3.0 (default, Oct 8 2012, 21:38:46)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from lxml import etree
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'lxml'
>>>
任何关于如何在 python 3.3.0 下获取 lxml 模块的指针将不胜感激。