Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python cgi server module not found [duplicate]

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?

like image 970
Loïc Noest Avatar asked Mar 13 '23 11:03

Loïc Noest


1 Answers

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
like image 92
Daniel Roseman Avatar answered Mar 19 '23 06:03

Daniel Roseman