1

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

Azazel
  • 167
  • 3
  • 12
  • 1
    I get error: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-rhy16f8i/html/ When I tried pip3 install html – Azazel Aug 13 '18 at 15:39
  • 2
    The html module is part of the standard library, you shouldn't need to install it separately and this may be indicative of a problem with the python installation on this system. – Ben Aug 13 '18 at 15:41
  • 1
    Are you sure you're using Python 3.5? That version has [an `html` module built in](https://docs.python.org/3/library/html.html). You might actually be using Python 2, which does not. – jwodder Aug 13 '18 at 15:42
  • Possible duplicate of [Python error "ImportError: No module named"](https://stackoverflow.com/questions/338768/python-error-importerror-no-module-named) – colidyre Aug 13 '18 at 15:53

2 Answers2

0

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.

0

This happens when you run .py scripts for version 3 with the python.exe version 2. I my case, running python from any directory would always start up version 3, however, windows file associations for .py extension were made for the older python directory.