can't install http module

Chris Angelico rosuav at gmail.com
Thu Nov 7 14:39:19 EST 2019


On Fri, Nov 8, 2019 at 6:34 AM Tony van der Hoff <lists at vanderhoff.org> wrote:
>
>
>
> On 07/11/2019 19:00, Chris Angelico wrote:
> > On Fri, Nov 8, 2019 at 5:47 AM tony van der Hoff <lists at vanderhoff.org> wrote:
> >>
> >> Hi,
> >> I'm attempting to install (among other things) the "http" module on my
> >> debian10 box, and am encountering the following problem:
> >>
> >
> > Can you link to the documentation for the package you're trying to
> > install? Python already ships with a module called "http". You don't
> > need to install it.
> >
> Thanks Chris, but it doesn't seem to be installed here, but maybe I'm
> doing something stupid:
>
> #!/usr/bin/env python
> # -*- coding: UTF-8 -*-
>

Ah. I wouldn't call this "something stupid", because this is a bit of
a gotcha, but there is a small problem here. In your original post,
you attempted to install using "python3 -m pip", but here your shebang
just says "python", so you're running it in Python 2.7. Replace the
shebang with "python3" (and then drop the coding cookie - Python 3
assumes UTF-8 by default) and you should be able to run your code. (At
least the import lines you posted. No idea about anything else.)

ChrisA


More information about the Python-list mailing list