No module named server

T

Thomas Lehmann

Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit
(Intel)] on win32

Script:
from http.server import HTTPServer, CGIHTTPRequestHandler

Result:
Traceback (most recent call last):
File "http.py", line 1, in <module>
from http.server import HTTPServer, CGIHTTPRequestHandler
File "F:\Checkouts\projects\python\http.py", line 1, in <module>
from http.server import HTTPServer, CGIHTTPRequestHandler
ImportError: No module named server
 
T

Thomas Lehmann

Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit

Also after installing Python 3.1.2 the problem is still there.
 
A

Andi Albrecht

Thomas Lehmann said:
Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit
(Intel)] on win32

Script:
from http.server import HTTPServer, CGIHTTPRequestHandler

Result:
Traceback (most recent call last):
File "http.py", line 1, in <module>
from http.server import HTTPServer, CGIHTTPRequestHandler
File "F:\Checkouts\projects\python\http.py", line 1, in <module>
from http.server import HTTPServer, CGIHTTPRequestHandler
ImportError: No module named server

You should rename http.py since it collides with the "http" module
you're trying to import the server and request handler classes from.

Andi
 
T

Thomas Lehmann

Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit

Also after installing Python 3.1.2 the problem is still there.

I know the problem.

Reading a book about a simple cgi web server the descriptions says
to use httpd.py as name for the file and I forgot the 'd'.

This leads to the wrong behaviour.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top