Python not working in command prompt?


Question

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.

1
43
8/30/2017 10:51:59 PM

Accepted Answer

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.

52
11/28/2012 2:51:30 AM

The video was very useful.

  1. Go to system properties -> Advance ( or type "system env" in start menu.)
  2. Click environment variables
  3. Edit the 'PATH' variable
  4. Add 2 new paths 'C:\Python27' and 'C:\Python27\scripts'
  5. Run cmd again and type python.

it worked for me


Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon