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

Olav OlavB at
Thu Sep 7 17:14:58 CEST 2000

Calvelo Daniel wrote:

> It seems that your script is not interpreted by Python. Those are not
> Python errors.

No, the script is interpreted.  The problem is  importing  the

/home/olav> cat
print "Hello world"
Can't find file Hello world
/home/olav> cat
import os
print "Hello world"
import: not found
Can't find file Hello world
/home/olav> python
Hello world

(....That it is trying to look for the file-name instead of printing is
also interesting.....)

> 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 am uing PATHEXT=.COM;.EXE;.BAT;.CMD;.ph
(in the NT environment this variable is in fact not visible in cygwin)

.....Though perhaps I should look into the "#"-way of doing it?


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

More information about the Python-list mailing list