[FIXED] 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


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 – Candace Johnson (Easybugfix Volunteer)

Leave a Reply

(*) Required, Your email will not be published