2

I'm trying to use this commmand:

python -m SimpleHTTPServer 

but it's not working. I'm guessing that it isn't working because I'm running that through Windows Command Prompt. How does one make that function?

The error I am getting from Command Prompt is: "'python' is not recognized as an internal or external command, operable program or batch file"

  • "its not working" is not very helpful in debugging an issue. What is the specific error are you getting? – heavyd Jul 3 '14 at 20:20
  • "'python' is not recognized as an internal or external command, operable program or batch file" – vdogsandman Jul 3 '14 at 20:22
3

By default, python is not registered as a command in the windows command prompt. (Be it a file in the PATH, a macro or something else entirely).

The solution is to simply type the whole path to the python.exe. I installed Python to C:\Python27 so all I need to type is

C:\Python27\python.exe /m SimpleHTTPServer 
  • That did it. And then I added it to PATH, because that's easier. – Rudie Oct 12 '14 at 17:02
2

Based on the error you provided, it looks like you didn't add Python to your path environment variable.

2

If you recently installed Python 3.x, try searching for "Python" in windows file explorer. Mine was installed under: C:\Users\XXXX\AppData\Local\Programs\Python\Python36-32\

Use Command prompt to navigate to this directory, and then type "Python.exe - m http.server"

You should be good to go.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.