I've been using Python for some time now, but I have never been able to properly run it from the Windows command line. The error shown is:
C:\Windows\system32>python
'python' is not recognized as an internal or external command, operable program or batch file.
I've tried to solve the problem many times. I understand it's a matter of editing the environment variables, but this hasn't fixed the problem. My System Path variable is currently
C:\Python27;C:\Python27\Lib;C:\Python27\DLLs;C:\Python27\Lib\lib-tk
This is the correct location of Python in my directory. I've tried adding this to my User Path, and I've tried creating a PYTHONPATH variable containing them.
I should note that running python.exe does work.
C:\Windows\system32>python.exe
Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win 32 Type "help", "copyright", "credits" or "license" for more information.
I've tried a variety of solutions to no avail. Any help is greatly appreciated.
python.exeworks, butpythondoesn't, it sounds like you've messed up thePATHEXTenvironment variable. It specifies the extensions to try when you don't specify one in the command. Mine looks likePATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW;.PYC;.PYO;.tcl.PATH:C:\Python27\Lib;C:\Python27\DLLs;C:\Python27\Lib\lib-tk. Python's import system looks in these directories for modules. They're pre-configured, so don't set them inPYTHONPATHeither; that would cause problems if Python 3 is also installed.