'http' module is missing

'http' module is missing

Postby NikosGr » Thu Nov 21, 2013 4:20 pm

Hello from some reason 'http' module is missing and i cannot use pip to install it. please help/ i'am on CentOS v6.4

Code: Select all
File "metrites.py", line 7, in <module>
from http import cookies
ImportError: No module named http

=======================================

root@secure [/home/nikos/www/cgi-bin]# pip install http
Downloading/unpacking http
Downloading http-0.02.tar.gz
Running setup.py egg_info for package http
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip_build_root/http/setup.py", line 3, in <module>
import http
File "./http/__init__.py", line 17, in <module>
from request import Request
ImportError: No module named 'request'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "<string>", line 16, in <module>

File "/tmp/pip_build_root/http/setup.py", line 3, in <module>

import http

File "./http/__init__.py", line 17, in <module>

from request import Request

ImportError: No module named 'request'

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/http
Storing complete log in /root/.pip/pip.log
root@secure [/home/nikos/www/cgi-bin]#
NikosGr
 
Posts: 48
Joined: Thu Mar 28, 2013 6:31 pm
Location: Thessaloniki

Re: 'http' module is missing

Postby Kebap » Thu Nov 21, 2013 4:23 pm

Why do you think there should be a module "http"? I would suggest you look into urllib2, etc.
Learn: How To Ask Questions The Smart Way
Join the #python-forum IRC channel on irc.freenode.net and chat with uns directly!
Kebap
 
Posts: 403
Joined: Thu Apr 04, 2013 1:17 pm
Location: Germany, Europe

Re: 'http' module is missing

Postby NikosGr » Thu Nov 21, 2013 4:28 pm

But up until now i was using 'from http import cookies' in Python 3.3.2

This is the standard library to get cookies from.

import cookielib
import urllib2

also fail to be found.
NikosGr
 
Posts: 48
Joined: Thu Mar 28, 2013 6:31 pm
Location: Thessaloniki

Re: 'http' module is missing

Postby stranac » Thu Nov 21, 2013 4:32 pm

What version of python are you using?
The http package is python 3 only.

If you're using python 2, the cookie module is what you want.
Friendship is magic!

R.I.P. Tracy M. You will be missed.
User avatar
stranac
 
Posts: 1246
Joined: Thu Feb 07, 2013 3:42 pm

Re: 'http' module is missing

Postby NikosGr » Thu Nov 21, 2013 4:36 pm

I'm using Python 3.3.2 and cookies are contained within http module, hwich cannot be found.
NikosGr
 
Posts: 48
Joined: Thu Mar 28, 2013 6:31 pm
Location: Thessaloniki

Re: 'http' module is missing

Postby Kebap » Thu Nov 21, 2013 6:06 pm

I have to say sorry, I know next to nothing about python 3.*
Learn: How To Ask Questions The Smart Way
Join the #python-forum IRC channel on irc.freenode.net and chat with uns directly!
Kebap
 
Posts: 403
Joined: Thu Apr 04, 2013 1:17 pm
Location: Germany, Europe

Re: 'http' module is missing

Postby NikosGr » Thu Nov 21, 2013 9:25 pm

My mistake: was firing python instead of python3

I did but it wasn't f nay help

'python3 metirtes.py' produces no error at all

Apache's error log produces no errors either, but i see just a blank page.
NikosGr
 
Posts: 48
Joined: Thu Mar 28, 2013 6:31 pm
Location: Thessaloniki


Return to Web Development

Who is online

Users browsing this forum: No registered users and 0 guests