首页 > 解决方案 > Python 3 html module import error?

问题描述

I am using python 3.5....One of the dependency file I am using has this line

import html

The file is also coded in python. So I get this error:

import html ImportError: No module named html

So I tried

sudo apt-get install html

And it gives me this error

E: Unable to locate package html

标签: pythonpython-3.xubuntu

解决方案


要安装 html 模块,请尝试以下操作:

pip install html

在 python 中导入 html 模块:

from html import HTML
h = HTML()

为了更好地理解这里是一个例子:

h.p('Hello, world!')
print h 

我希望它有效。


推荐阅读