Running python from cygwin with .py-extension --- import: not found

Olav OlavB at
Thu Sep 14 17:03:02 CEST 2000

Steve Holden wrote:

> I'm guessing that your shell is finding a "print" command on your PATH,
> but that the "print" command can't find what it thinks to be a file.

....You are right!

> > > I tried to use a script with a '#!/usr/bin/env python' first line
> > > and it works exactly as in UNIX, ie call it directly after a 'chmod +x'.
> >

I tried that.  It works! I just to make a link to have /usr/bin/env point to
(Cygwin was probably not in the standard location)

> > I am uing PATHEXT=.COM;.EXE;.BAT;.CMD;.ph
> > (in the NT environment this variable is in fact not visible in cygwin)
> >

I had in fact misspelled .ph instead of .py....  With this i can remove the
in NT, but not Cygwin.  Perhaps NutCracker would handle this better?
(I remember before i often needed the .bat-extension in Cygwin, but not


It also works, though both this and the "#"-method breaks when I try to run
scripts on my D-drive.
Cygwin will give Python a path starting with //D, which it can't find... (My
current drve is then the
C-drive, and Python.exe is also on the C-drive.

Anybody got a way around that?


Thanks Again!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list