Tuesday, October 4, 2022

[SOLVED] Python 3 html module import error?

Issue

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


Solution

To install html module try this:

pip install html

To import html module in python :

from html import HTML
h = HTML()

For better understanding here is an example :

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

I hope it works.



Answered By - Masud Rumii
Answer Checked By - Gilberto Lyons (WPSolving Admin)