Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

can't install http module

260 views
Skip to first unread message

tony van der Hoff

unread,
Nov 7, 2019, 1:46:43 PM11/7/19
to
Hi,
I'm attempting to install (among other things) the "http" module on my
debian10 box, and am encountering the following problem:

##########################
tony@tony-lx:~/_pycharm/pygallery$ python3 -m pip install http

Collecting http
  Using cached
https://files.pythonhosted.org/packages/e3/91/a9260805e532e33df273b8f7dffad5c51693f8f9ba5f86bedcf42a7f22eb/http-0.02.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-fr02g_f6/http/setup.py", line 3, in <module>
        import http
      File "/tmp/pip-install-fr02g_f6/http/http/__init__.py", line 17,
in <module>
        from request import Request
    ModuleNotFoundError: No module named 'request'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in
/tmp/pip-install-fr02g_f6/http/

##########################
So, I tried installing "request":

##########################

tony@tony-lx:~/_pycharm/pygallery$ python3 -m pip install request
Collecting request
  Downloading
https://files.pythonhosted.org/packages/f1/27/7cbde262d854aedf217061a97020d66a63163c5c04e0ec02ff98c5d8f44e/request-2019.4.13.tar.gz
Collecting get (from request)
  Downloading
https://files.pythonhosted.org/packages/3f/ef/bb46f77f7220ac1b7edba0c76d810c89fddb24ddd8c08f337b9b4a618db7/get-2019.4.13.tar.gz
Collecting post (from request)
  Downloading
https://files.pythonhosted.org/packages/0f/05/bd79da5849ea6a92485ed7029ef97b1b75e55c26bc0ed3a7ec769af666f3/post-2019.4.13.tar.gz
Requirement already satisfied: setuptools in
/usr/lib/python3/dist-packages (from request) (40.8.0)
Collecting query_string (from get->request)
  Downloading
https://files.pythonhosted.org/packages/12/3c/412a45daf5bea9b1d06d7de41787ec4168001dfa418db7ec8723356b119f/query-string-2019.4.13.tar.gz
Collecting public (from query_string->get->request)
  Downloading
https://files.pythonhosted.org/packages/54/4d/b40004cc6c07665e48af22cfe1e631f219bf4282e15fa76a5b6364f6885c/public-2019.4.13.tar.gz
Building wheels for collected packages: request, get, post,
query-string, public
  Running setup.py bdist_wheel for request ... done
  Stored in directory:
/home/tony/.cache/pip/wheels/30/84/5f/484cfba678967ef58c16fce6890925d5c7172622f20111fbfd
  Running setup.py bdist_wheel for get ... done
  Stored in directory:
/home/tony/.cache/pip/wheels/c1/e3/c1/d02c8c58538853e4c9b78cadb74f6d5c5c370b48a69a7271aa
  Running setup.py bdist_wheel for post ... done
  Stored in directory:
/home/tony/.cache/pip/wheels/c3/c3/24/b5c132b537ab380c02d69e6bd4dec1f5db56b5fe19030473d7
  Running setup.py bdist_wheel for query-string ... done
  Stored in directory:
/home/tony/.cache/pip/wheels/d6/a4/78/01b20a9dc224dcc009fab669f7f27b943b8889c5150bd68d8a
  Running setup.py bdist_wheel for public ... done
  Stored in directory:
/home/tony/.cache/pip/wheels/23/7c/6e/f5b4e09d6596c8b8802b347e48f149031e2363368048f1347a
Successfully built request get post query-string public
Installing collected packages: public, query-string, get, post, request
Successfully installed get-2019.4.13 post-2019.4.13 public-2019.4.13
query-string-2019.4.13 request-2019.4.13
##########################
So far, so good; retry http:

##########################

tony@tony-lx:~/_pycharm/pygallery$ python3 -m pip install http
Collecting http
  Using cached
https://files.pythonhosted.org/packages/e3/91/a9260805e532e33df273b8f7dffad5c51693f8f9ba5f86bedcf42a7f22eb/http-0.02.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-zwguez5m/http/setup.py", line 3, in <module>
        import http
      File "/tmp/pip-install-zwguez5m/http/http/__init__.py", line 17,
in <module>
        from request import Request
    ImportError: cannot import name 'Request' from 'request'
(/home/tony/.local/lib/python3.7/site-packages/request/__init__.py)

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in
/tmp/pip-install-zwguez5m/http/

##########################
So now I seem to have broken it. I'm not very savvy with the python
packaging system, so perhaps someone here can help me as a numpty.
Thanks in advance.


-- Tony van der Hoff | mailto:to...@vanderhoff.org Buckinghamshire, England |

Chris Angelico

unread,
Nov 7, 2019, 2:01:08 PM11/7/19
to
On Fri, Nov 8, 2019 at 5:47 AM tony van der Hoff <li...@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.

ChrisA

Tony van der Hoff

unread,
Nov 7, 2019, 2:33:10 PM11/7/19
to
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 -*-

import cgi
import logging
from http import cookies


[Thu Nov 07 17:29:24.002303 2019] [cgi:error] [pid 30937] [client
127.0.0.1:41912] AH01215: Traceback (most recent call last)::
/home/tony/public_html/private/pygallery/pygallery.py
[Thu Nov 07 17:29:24.002455 2019] [cgi:error] [pid 30937] [client
127.0.0.1:41912] AH01215: File
"/home/tony/public_html/private/pygallery/pygallery.py", line 6, in
<module>: /home/tony/public_html/private/pygallery/pygallery.py
[Thu Nov 07 17:29:24.002480 2019] [cgi:error] [pid 30937] [client
127.0.0.1:41912] AH01215: from http import cookies:
/home/tony/public_html/private/pygallery/pygallery.py
[Thu Nov 07 17:29:24.002502 2019] [cgi:error] [pid 30937] [client
127.0.0.1:41912] AH01215: ImportError: No module named http:
/home/tony/public_html/private/pygallery/pygallery.py

Chris Angelico

unread,
Nov 7, 2019, 2:39:48 PM11/7/19
to
On Fri, Nov 8, 2019 at 6:34 AM Tony van der Hoff <li...@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 <li...@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

Tony van der Hoff

unread,
Nov 8, 2019, 4:43:24 AM11/8/19
to
Excellent catch, Chris. Thank you so much. I changed the version while
tracking down another problem, and forgot to restore it.
It should have been obvious, but somehow it escaped me.

Thanks again, Tony.
0 new messages