[Tutor] help with getting python to run from command prompt on Windows XP

wesley chun wescpy at gmail.com
Wed Jan 14 21:09:27 CET 2009


On Wed, Jan 14, 2009 at 12:01 PM, Kent Johnson <kent37 at tds.net> wrote:
> On Wed, Jan 14, 2009 at 2:36 PM, Brian van den Broek
> <broek at cc.umanitoba.ca> wrote:
>>
>> He's got python 2.6.1 installed as evidenced by the Startbar program
>> icon for Idle launching as expected. When run from IDLE, `print
>> sys.executable' yields `C:\\Python26\\pythonw.exe'.
>> He reports that C:\Python26 contains both python.exe and pythonw.exe.
>>
>> I've had him add the text `;C:\Python26' (without quotes) to the end
>> of his Path environment variable via the Control Panel|System
>> Properties way of editing Environment variables. I've had him reboot
>> afterwards.
>>
>> After all of that, he reports that an attempt to run python from the
>> command prompt produces a complaint that `` `python' is not recognized
>> as an internal or external command, operable program or batch file.''
>
> It sounds to me like you have asked him to do the right thing. I would try
> - check the Path setting by typing 'set path' at a command prompt and
> verify that C:\Python26 is in the displayed path
> - try running Python with a full path, i.e. at the command prompt try
> 'C:\Python26\python.exe'


i fully agree with kent's comments/suggestions. you appeared to have
them do the right thing. fwiw, the only time i run into that error
after doing the same thing as you is that i'm trying that command in
an already-opened command window -- i need to close that and open
another that takes in the changes to the environment variables. but
you did tell them to reboot, so this shouldn't be your problem.

also, i think (but cannot confirm as i'm on a mac now that) there are
two PATH env vars... one for the current user and one for all users
(if you have administrative privileges.

good luck!
-- wesley
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"Core Python Programming", Prentice Hall, (c)2007,2001
"Python Fundamentals", Prentice Hall, (c)2009
    http://corepython.com

wesley.j.chun :: wescpy-at-gmail.com
python training and technical consulting
cyberweb.consulting : silicon valley, ca
http://cyberwebconsulting.com


More information about the Tutor mailing list