Why XP can not run Python after being setting the PATH?

John Machin sjmachin at lexicon.net
Fri Jul 28 17:09:16 EDT 2006


Daniel Mark wrote:

>
> Also, I list some screen shot from my machine as follows:
>
> C:\Program Files\Python24>cd \
>
> C:\>python

#### Note: *no* error message !!! [or you edited the screen shot]

Hypothesis: there is something called python.exe or python.bat or
whatever somewhere in your path before the c:\program files\python24
[*OR* in the root (c:\) folder!!!]. When run, it does nothing (we
hope!).

Try getting it to mumble something that might reveal its identity, by
typing something like

C:\>python -h
C:\>python /?
C:\>python foo bar zot

Have a look in each of those folders (including the root!!) and see
what you find there. [If I were forced to bet, I'd put my money on
cygwin].
Then either adjust your path or blow away the intruder. If you aren't
sure which is more appropriate, ask.

BTW, most folk got out of the habit of issuing commands at the root
directory level (and keeping files at that level) pretty soon after
MS-DOS 2.0 came out. Following that herd is not such a bad idea :-)

> C:\>"Program Files\Python24\python.exe"
> Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)]
> on win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> ^Z
>
>
> C:\>Program\ Files\Python24\python.exe
> 'Program\' is not recognized as an internal or external command,
> operable program or batch file.

#### This is the expected error message.

>
> C:\>python111
> 'python111' is not recognized as an internal or external command,
> operable program or batch file.
>
> It seems that XP know there is python.exe there, but cannot run it
> correctly if
> i use c:\python
>
> The only way works on my machine is to run with full path.
> 
> Maybe there is not solution to this problem:)?




More information about the Python-list mailing list