I am using Windows 7 and have Python 2.7 installed in C:\Python27a. This location has been added to my Path system variable. When I use the command prompt, typing python returns the error message python' is not recognized... However using Powershell I can type in python and it starts as expected.
I have had another user confirm that the Path variable is correct by installing Python on his machine, adding the location to Path, and running from the command prompt in the exact same fashion that I attempted. I am lead to believe that at some point (which I can't remember) I foolishly changed a setting in Powershell that makes it access the Path whereas CMD no longer can.
This is my Path variable (the python location is at the end):
C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\MKS Toolkit\mksnt;C:\PROGRA~2\MKSTOO~1\bin64;C:\PROGRA~2\MKSTOO~1\bin;C:\PROGRA~2\MKSTOO~1\bin\X11;C:\PROGRA~2\MKSTOO~1\mksnt;C:\IBM\InformationServer/jdk32\jre\bin;C:\IBM\InformationServer/jdk32\jre\bin\j9vm;C:\IBM\InformationServer\ASBNode\lib\cpp;C:\IBM\InformationServer\ASBNode\apps\proxy\cpp\vc60\MT_dll\bin;C:\Program Files\Common Files\Microsoft Shared\Microsoft Online Services;C:\Program Files (x86)\Common Files\Microsoft Shared\Microsoft Online Services;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn";C:\Python27a
This is not a serious problem, as I can still run Python by manually changing to the directory C:\Python27 before entering python or I can always just use IDLE, but I am curious why this is happening and how it can be resolved?
RESOLVED: I fixed this by placing "C:\Python27a" earlier in the the Path variable. The multiple occurrences of %SystemRoot% seemed suspicious to me, so I wanted to read the python location first and sure enough, it now works. I don't know yet what the underlying cause of the problem was, but I will report back when I find out.
pathat the command prompt?