python - 无法在 Python 中打开 html5lib

标签 python package html5lib

我刚刚使用 Windows 命令提示符为 Python 安装了 html5lib。包安装在这里:

File "C:\Python27\lib\site-packages\html5lib

但是,如果我尝试导入 html5lib:

#! /usr/bin/python
import html5lib

我收到以下错误:

Traceback (most recent call last):
File "C:\Users\workspace\testhtml5\src\test.py", line 2, in <module>
import html5lib
File "C:\Python27\lib\site-packages\html5lib\__init__.py", line 16, in <module>
from .html5parser import HTMLParser, parse, parseFragment
File "C:\Python27\lib\site-packages\html5lib\html5parser.py", line 2, in <module>
from six import with_metaclass
ImportError: No module named six

知道可能导致错误的原因吗?谢谢

最佳答案

您缺少 six 模块。您可以从here下载。 ,或者更好,使用 pip install six

关于python - 无法在 Python 中打开 html5lib,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17258003/

相关文章:

javascript - 从包中的meteor主应用程序访问对象

python - 如何在 html5lib 中修复 "unexpected keyword argument ' useChardet'"

python - 从序列中减去数据框(或其唯一的列)

python - 在 Numpy 中计算累积返回,数组索引问题

javascript - 如何在 Angular 库的 node_modules 文件夹之外使用 *.d.ts?

java - 尽管设置正确,Eclipse 仍无法识别自定义类

python - Beautifulsoup 功能在特定场景下无法正常工作

php - 在 PHP 中使用 html5lib 的 Xpath

python - 在预测类别概率时检查 GradientBoostingClassifier 的准确性

python - 区分组中的对象