python - 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
解决方案
要安装 html 模块,请尝试以下操作:
pip install html
在 python 中导入 html 模块:
from html import HTML
h = HTML()
为了更好地理解这里是一个例子:
h.p('Hello, world!')
print h
我希望它有效。
推荐阅读
- google-apps-script - 谷歌脚本编辑器:通过动态“X”复制和粘贴特定数据范围?
- javascript - 为什么 getElementById 不被识别?
- python - 如何在 numpy python 中用 antoher 增加一个向量
- google-apps-script - 用户对此配置文件没有足够的权限。- 谷歌分析 API v4
- sql-server - 在同步提交模式下使用只读副本,查询是否有可能在辅助节点上获得与主节点不同的结果?
- mapstruct - mapstruct空检查导致spotbug错误
- php - 我怎样才能给其他数组值键与指定数组相同?
- kubernetes-helm - Helm values.yaml 文件中的动态变量
- wordpress - Wordpress:WP_Query 中的多个分类术语
- django - django.db.utils.ProgrammingError:类型“hstore”不存在