Discussion:
python3 - No module named 'html5lib'
(too old to reply)
Sergio Spina
2016-04-14 09:31:59 UTC
Permalink
I'm running a python3 program that requires html5lib but I receive the error No module named 'html5lib'.

Here are two session of terminal:

***@pc ~ $ python
Python 2.7.9 (default, Mar 1 2015, 12:57:24)
[GCC 4.9.2] on linux2
import html5lib
html5lib.__file__
'/usr/local/lib/python2.7/dist-packages/html5lib/__init__.pyc'
quit()
***@pc ~ $ python3
Python 3.4.2 (default, Oct 8 2014, 10:45:20)
[GCC 4.9.1] on linux
import html5lib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'html5lib'

Where can be the problem?
Ben Finney
2016-04-14 10:37:29 UTC
Permalink
Post by Sergio Spina
I'm running a python3 program that requires html5lib but I receive the
error No module named 'html5lib'.
Right, the Python 3 standard library does not have any module by that
name.

If it is to be available, it will need to be installed somehow.

What leads you to think it is available on your system?
--
\ “Program testing can be a very effective way to show the |
`\ presence of bugs, but is hopelessly inadequate for showing |
_o__) their absence.” —Edsger W. Dijkstra |
Ben Finney
Steven D'Aprano
2016-04-14 11:47:03 UTC
Permalink
Post by Sergio Spina
I'm running a python3 program that requires html5lib but I receive the
error No module named 'html5lib'.
Python 2.7.9 (default, Mar 1 2015, 12:57:24)
[GCC 4.9.2] on linux2
import html5lib
html5lib.__file__
'/usr/local/lib/python2.7/dist-packages/html5lib/__init__.pyc'
quit()
You have installed html5lib as a library for Python 2.7.

Or possibly your Linux distribution has installed it.
Post by Sergio Spina
Python 3.4.2 (default, Oct 8 2014, 10:45:20)
[GCC 4.9.1] on linux
import html5lib
File "<stdin>", line 1, in <module>
ImportError: No module named 'html5lib'
Where can be the problem?
Python 3 has its own set of libraries, and doesn't automatically use the
Python 2 libraries.

My guess is that if you installed html5lib using yum or apt-get, there will
be a similar command that will install the Python 3 version.
--
Steven
Dennis Lee Bieber
2016-04-14 12:15:46 UTC
Permalink
Post by Ben Finney
What leads you to think it is available on your system?
Most likely that fact that it is in their Python 2.7 version shown
immediately above the 3.4 failure <G>

But yes -- that most likely only reflects that someone, at some time in
the past, did install a third-party package (probably more than one <G>)
--
Wulfraed Dennis Lee Bieber AF6VN
***@ix.netcom.com HTTP://wlfraed.home.netcom.com/
Wildman
2016-04-14 15:53:46 UTC
Permalink
Post by Sergio Spina
I'm running a python3 program that requires html5lib but I receive the error No module named 'html5lib'.
Python 2.7.9 (default, Mar 1 2015, 12:57:24)
[GCC 4.9.2] on linux2
import html5lib
html5lib.__file__
'/usr/local/lib/python2.7/dist-packages/html5lib/__init__.pyc'
quit()
Python 3.4.2 (default, Oct 8 2014, 10:45:20)
[GCC 4.9.1] on linux
import html5lib
File "<stdin>", line 1, in <module>
ImportError: No module named 'html5lib'
Where can be the problem?
apt-get install python3-html5lib
--
<Wildman> GNU/Linux user #557453
The cow died so I don't need your bull!
Sergio Spina
2016-04-15 17:56:44 UTC
Permalink
Post by Wildman
Post by Sergio Spina
I'm running a python3 program that requires html5lib but I receive the error No module named 'html5lib'.
Python 2.7.9 (default, Mar 1 2015, 12:57:24)
[GCC 4.9.2] on linux2
import html5lib
html5lib.__file__
'/usr/local/lib/python2.7/dist-packages/html5lib/__init__.pyc'
quit()
Python 3.4.2 (default, Oct 8 2014, 10:45:20)
[GCC 4.9.1] on linux
import html5lib
File "<stdin>", line 1, in <module>
ImportError: No module named 'html5lib'
Where can be the problem?
apt-get install python3-html5lib
--
<Wildman> GNU/Linux user #557453
The cow died so I don't need your bull!
It works, many thanks.

Continue reading on narkive:
Loading...