If the default python on your machine is python 3 so running the following command will result an error:
So use instead:
The python 2.7 doc warns:
Note : The
SimpleHTTPServer
module has been merged intohttp.server
in Python 3. The 2to3 tool will automatically adapt imports when converting your sources to Python 3.
You can also check the python 3.5 doc.
Note that on some machines python
redirects to python 2 and on some others to python 3, so if you want a command that always works use python3 -m http.server
or python2 -m SimpleHTTPServer
.