windows - Python 2.7 won't run in command line, yes I added to path variable

08
2014-07
  • Questioner

    Can't figure this out. I have followed the tutorials I have found to a T and it still won't run from cmd. I tried uploading a screenshot to show that C:\Python27 is in the Path env variable but I can't because I am a new user. Windows 7. See 'python' is not recognized as an internal...

    C:\Users\paleus>python
    'python' is not recognized as an internal or external command,
    operable program or batch file.
    
    C:\Users\paleus>set PATH
    Path=C:\Program Files (x86)\MKS Toolkit\mksnt;C:\PROGRA~2\MKSTOO~1\bin64;C:\PROG
    RA~2\MKSTOO~1\bin;C:\PROGRA~2\MKSTOO~1\bin\X11;C:\PROGRA~2\MKSTOO~1\mksnt;C:\IBM
    \InformationServer\ASBNode\apps\jre\bin\classic;C:\IBM\InformationServer\ASBNode
    \lib\cpp;C:\IBM\InformationServer\ASBNode\apps\proxy\cpp\vc60\MT_dll\bin;C:\Wind
    ows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowe
    rShell\v1.0\;C:\Program Files (x86)\QuickTime\QTSystem";C:\Program Files\Tortois
    eSVN\bin;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Python27\
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.sh;.ksh;.csh;.sed
    ;.awk;.pl
    
    C:\Users\paleus>
    
  • Answers
  • Andrew Clark

    Looks like there is an unmatched double quote in your PATH variable for the following entry (fourth from the end):

    C:\Program Files (x86)\QuickTime\QTSystem"
                                             ^
    

  • Related Question

    windows - How come Win+R prompt can open Python when it's not in my path?
  • houbysoft

    When I use the run prompt in Windows XP Professional (Win+R), and type python.exe or python, it works and greets me with the python prompt.

    However, when I start a cmd window, and then type python.exe or python, it doesn't find it.

    This is what I expect, as the Python directory (for me, I:\Python31\) is not in my PATH.

    How come, then, that if I type python.exe in the Win+R prompt, it works?

    Edit: here is a partial output of SET, I removed most irrelevant entries, I'm not sure why is it useful, apart from the PATH variable which I already said doesn't include the Python directory. If you need a particular variable other than these, please ask.

    CLIENTNAME=Console
    CommonProgramFiles=I:\Program Files\Common Files
    ComSpec=I:\WINDOWS\system32\cmd.exe
    FP_NO_HOST_CHECK=NO
    OS=Windows_NT
    Path=I:\WINDOWS\system32;I:\WINDOWS;I:\WINDOWS\system32\WBEM;I:\WINDOWS\system32\WindowsPowerShell\v1.0;I:\Qt\2010.05\mingw\bin;I:\Program Files\CMake 2.8\bin
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.PSC1
    ProgramFiles=I:\Program Files
    PROMPT=$P$G
    SESSIONNAME=Console
    SystemDrive=I:
    SystemRoot=I:\WINDOWS
    VBOX_INSTALL_PATH=I:\Program Files\Oracle\VirtualBox\
    windir=I:\WINDOWS
    

  • Related Answers
  • jcrawfordor

    the Run prompt searches a registry path for programs to launch as well as the %path%. Take a look at HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths - you'll likely find a node called "Python.exe" with the default entry pointing to the Python executable. Installers should add registry entries for all main executables here, but the Run prompt is an underappreciated feature, so a lot of developers forget to add this simple step to their installer.