本文介绍了无法在Python中打开html5lib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在Windows命令提示符下安装了适用于Python的html5lib.该软件包已安装在这里:

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

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

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

However, if I try to import 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

关于什么可能导致错误的任何想法?谢谢

Any idea on what might be causing the error? Thanks

推荐答案

您缺少six模块.您可以从此处下载它,或者最好使用pip install six.

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

这篇关于无法在Python中打开html5lib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 05:31