Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #106989 > unrolled thread

python3 - No module named 'html5lib'

Started bySergio Spina <sergio.am.spina@gmail.com>
First post2016-04-14 02:31 -0700
Last post2016-04-15 10:56 -0700
Articles 6 — 5 participants

Back to article view | Back to comp.lang.python


Contents

  python3 - No module named 'html5lib' Sergio Spina <sergio.am.spina@gmail.com> - 2016-04-14 02:31 -0700
    Re: python3 - No module named 'html5lib' Ben Finney <ben+python@benfinney.id.au> - 2016-04-14 20:37 +1000
    Re: python3 - No module named 'html5lib' Steven D'Aprano <steve@pearwood.info> - 2016-04-14 21:47 +1000
    Re: python3 - No module named 'html5lib' Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-04-14 08:15 -0400
    Re: python3 - No module named 'html5lib' Wildman <best_lay@yahoo.com> - 2016-04-14 10:53 -0500
      Re: python3 - No module named 'html5lib' Sergio Spina <sergio.am.spina@gmail.com> - 2016-04-15 10:56 -0700

#106989 — python3 - No module named 'html5lib'

FromSergio Spina <sergio.am.spina@gmail.com>
Date2016-04-14 02:31 -0700
Subjectpython3 - No module named 'html5lib'
Message-ID<bcc33204-d80c-4720-9673-adca1f413559@googlegroups.com>
I'm running a python3 program that requires html5lib but I receive the error No module named 'html5lib'.

Here are two session of terminal:

    sam@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()

    sam@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?

[toc] | [next] | [standalone]


#106991

FromBen Finney <ben+python@benfinney.id.au>
Date2016-04-14 20:37 +1000
Message-ID<mailman.101.1460630257.15650.python-list@python.org>
In reply to#106989
Sergio Spina <sergio.am.spina@gmail.com> writes:

> 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

[toc] | [prev] | [next] | [standalone]


#106993

FromSteven D'Aprano <steve@pearwood.info>
Date2016-04-14 21:47 +1000
Message-ID<570f8339$0$1590$c3e8da3$5496439d@news.astraweb.com>
In reply to#106989
On Thu, 14 Apr 2016 07:31 pm, Sergio Spina wrote:

> I'm running a python3 program that requires html5lib but I receive the
> error No module named 'html5lib'.
> 
> Here are two session of terminal:
> 
>     sam@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()

You have installed html5lib as a library for Python 2.7.

Or possibly your Linux distribution has installed it.


>     sam@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?

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

[toc] | [prev] | [next] | [standalone]


#106996

FromDennis Lee Bieber <wlfraed@ix.netcom.com>
Date2016-04-14 08:15 -0400
Message-ID<mailman.103.1460636146.15650.python-list@python.org>
In reply to#106989
On Thu, 14 Apr 2016 20:37:29 +1000, Ben Finney <ben+python@benfinney.id.au>
declaimed the following:

>
>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
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

[toc] | [prev] | [next] | [standalone]


#107002

FromWildman <best_lay@yahoo.com>
Date2016-04-14 10:53 -0500
Message-ID<i7OdnbnsxPOXIJLKnZ2dnUU7-emdnZ2d@giganews.com>
In reply to#106989
On Thu, 14 Apr 2016 02:31:59 -0700, Sergio Spina wrote:

> I'm running a python3 program that requires html5lib but I receive the error No module named 'html5lib'.
> 
> Here are two session of terminal:
> 
>     sam@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()
> 
>     sam@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?

apt-get install python3-html5lib

-- 
<Wildman> GNU/Linux user #557453
The cow died so I don't need your bull!

[toc] | [prev] | [next] | [standalone]


#107069

FromSergio Spina <sergio.am.spina@gmail.com>
Date2016-04-15 10:56 -0700
Message-ID<223d0e55-08cc-4502-8c54-19532c9e72ee@googlegroups.com>
In reply to#107002
Il giorno giovedì 14 aprile 2016 17:54:00 UTC+2, Wildman ha scritto:
> On Thu, 14 Apr 2016 02:31:59 -0700, Sergio Spina wrote:
> 
> > I'm running a python3 program that requires html5lib but I receive the error No module named 'html5lib'.
> > 
> > Here are two session of terminal:
> > 
> >     sam@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()
> > 
> >     sam@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?
> 
> apt-get install python3-html5lib
> 
> -- 
> <Wildman> GNU/Linux user #557453
> The cow died so I don't need your bull!

It works, many thanks.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web