5

When I run python -m SimpleHTTPServer 8000 or python -m CGIHTTPServer 8000 in cmd, I get this error :

No module named SimpleHTTPServer

or

No module named CGIHTTPServer

Does anyone know why this happens or another way to test python cgi-scripts?

Olivier De Meulder
  • 2,493
  • 3
  • 25
  • 30
Loïc Noest
  • 125
  • 1
  • 11

2 Answers2

8

That's not how you start those from the command line.

See the docs: the basic HTTP server is started with

python -m http.server 8000

and the CGI server with

python -m http.server --cgi 8000
Daniel Roseman
  • 588,541
  • 66
  • 880
  • 895
0

Fom this answer:

python -m http.server [<portNo>]
Community
  • 1
  • 1
Paul
  • 6,641
  • 8
  • 41
  • 56