The python not starting under cmd.exe

Ulrich Eckhardt eckhardt at satorlaser.com
Wed Aug 13 05:01:47 EDT 2008


durumdara at gmail.com wrote:
> The "test.py" is working in every machine that I use except in my home
> machine.
[...]
>     c:\>test.py
>     A rendszer nem tudja végrehajtani a megadott programot.
> 
>     c:\>
> 
> 
> Sorry for non english, I try to translate it:
> "The system cannot execute the program/application."
> 
> Interesting thing that the starting from Explorer, FreeCommander, or
> other tool (Double clicking, Hit enter on it) is working good, so the
> "py" linked to the python.

Maybe, maybe not. This 'linked to' is a notion of the shell (i.e. the
Explorer) so it doesn't apply to the CLI necessarily. Anyhow: I guess you
also can't run the interactive Python interpreter from the commandline
(just type 'python' to test that). If that is the case, you simply need to
add the path to the interpreter to the PATH environment variable:

  set PATH=C:\Python42;%PATH%

You can also set this somewhere in your user profile, otherwise it only
affects the current commandline and processes started from it.

> I tried to set path, and pathext too but it have no effect.
> 
> This command is working:
> "python test.py".

Hmm, strange. From where did you issue that command? If it was from the
Python install dir, it will find the local python.exe even without the path
and might not do the same when it tries to find the handler from a call to
test.py. And what did you try to set the PATH and PATHEXT to?

Good luck and please drop a note if you manage to solve the issue!

Uli

-- 
Sator Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932




More information about the Python-list mailing list