The Python Oracle

Set up Python simpleHTTPserver on Windows

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game 2 Looping

--

Chapters
00:00 Question
00:36 Accepted answer (Score 636)
01:07 Thank you

--

Full question
https://stackoverflow.com/questions/1735...

Accepted answer links:
[What is the Python 3 equivalent of "python -m SimpleHTTPServer"]: https://stackoverflow.com/questions/7943...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #windows #python3x #simplehttpserver

#avk47



ACCEPTED ANSWER

Score 652


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.