试图安装可读性python API,我无法导入它

时间:2012-01-16 00:48:44

标签: python html xml readability

安装软件包后,我进入了python环境。我是python的新手,所以我导入了我需要的模块,但这个模块无法导入。有人可以帮我解决吗。

>>> import readability
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/readability/__init__.py", line 1, in <module>
    from .readability import Document
  File "/usr/local/lib/python2.7/dist-packages/readability/readability.py", line 2, in <module>
    from cleaners import html_cleaner, clean_attributes
  File "/usr/local/lib/python2.7/dist-packages/readability/cleaners.py", line 3, in <module>
    from lxml.html.clean import Cleaner
ImportError: No module named lxml.html.clean

我真的需要这个模块才能工作。我的印象是这是使用的模块 http://www.readability.com/ 并在苹果野生动物园read协议。

1 个答案:

答案 0 :(得分:1)

您可能没有安装lxml。您可以按照以下说明下载并安装它:http://lxml.de/installation.html