我刚刚使用 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/