261

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?

2
  • 4
    The module is called SimpleHTTPServer, with a capital S on Server. Commented Jun 27, 2013 at 18:52
  • 2
    same result with capital S also Commented Jun 27, 2013 at 18:53

1 Answer 1

654

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.

Sign up to request clarification or add additional context in comments.

7 Comments

Thanks a lot, this was really helpful. With python33 the command python -m http.server 7777 works perfectly.
Windows 7 , using Anaconda python, this worked great; $ python -m SimpleHTTPServer 7070
that's marvelous! even in windows i can do things with only 1 line in console. Bravo!
For the network novices (myself included), who use Windows, you'll want to open the port to allow connections from other computers: How to open firewall ports in Windows 10
Confirming that this works for Python 3.6.7 on Ubuntu 18.04 LTS ! Thanks
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.