No module named SimpleHTTPServer [Error]

Standard

I wanted to set up Python SimpleHTTPServer on my Windows 8 and I had Python installed on my computer. I was executing the following command

python -m SimpleHTTPServer 

Or(if you want to specify which port to open the application from)

python -m SimpleHTTPServer [<portNo>]

But I got the error:

C:\Python34\python.exe: No module named SimpleHTTPServer

error

Because I am using Python 3 the module SimpleHTTPServer has been replaced by http.server at least in Windows. So the following worked for me

python -m http.server [<portNo>]

soln

You will see the below screen. To test if it is working, go to http://localhost:8000/ and you should see a web page opening up.

final working

Hope that helped. Thanks!

Lima Kilo

Advertisements