255

I want to set up Python SimpleHTTPServer on Windows XP. I have Python installed on my computer. I am executing the following command:

python -m SimpleHTTPServer 8888

But I am getting the error:

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

Is SimpleHTTPServer for Python available on Windows? If yes, what do I do to set up the server?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
codeofnode
  • 18,169
  • 29
  • 85
  • 142

1 Answers1

643

From Stack Overflow question What is the Python 3 equivalent of "python -m SimpleHTTPServer":

SimpleHTTPServer is for python2, so you're getting the error.

In python3, The following works:

python -m http.server [<portNo>]

Because using Python 3, the module SimpleHTTPServer has been replaced by http.server, at least in Windows.

yaya
  • 7,675
  • 1
  • 39
  • 38
codeofnode
  • 18,169
  • 29
  • 85
  • 142