Can't open html5lib in Python

断了今生、忘了曾经 提交于 2019-12-14 03:51:20

问题


I just installed html5lib for Python with Windows Command Prompt. The package was installed here:

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

However, if I try to import html5lib:

#! /usr/bin/python
import html5lib

I get the following error:

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

Any idea on what might be causing the error? Thanks


回答1:


You're missing the six module. You can download it from here, or better, use pip install six .



来源:https://stackoverflow.com/questions/17258003/cant-open-html5lib-in-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!