Python not working in command prompt?

Rohit Rayudu picture Rohit Rayudu · Nov 28, 2012 · Viewed 402.1k times · Source

I type python into the command line, but the command prompt says that python is not recognized as an internal or external command, operable program, or batch file. What should I do?

Note: I have installed Python 2.7 and Python 3.2 onto my computer.

Answer

Rohit Rayudu picture Rohit Rayudu · Nov 28, 2012

It finally worked!!!

I needed to do things to get it to work

  1. Add C:\Python27\ to the end of the PATH system variable
  2. Add C:\Python27\ to the end of the PYTHONPATH system variable

I had to add these to both for it to work.

If I added any subdirectories, it did not work for some reason.

Thank you all for your responses.