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

2 thoughts on “No module named SimpleHTTPServer [Error]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s