Invoking python under CygWin on Windows hangs

James Kanze picture James Kanze · Nov 27, 2012 · Viewed 21.6k times · Source

Installing a new Windows system, I've installed CygWin and 64 bit Python (2.7.3) in their default locations (c:\cygwin and c:\Python27\python), and added both the CygWin bin and the Python directory to my path (in the user variable PATH). From the normal command window, Python starts up perfectly, but when I invoke it from bash in the CygWin environment, it hangs, never giving my the input prompt.

I've done this on other machines, previously, but always with older versions of Python (32 bits) and CygWin, and with Python in a decidely non-standard location. Has anyone else had this problem, or could someone tell me what it might be due to?

Answer

vikkyhacks picture vikkyhacks · Sep 7, 2013

Try this

python -i

and yes you will find some glitches here and there !!!

Option -i forces an interactive prompt as shown in Python help python -h page here.

$ python -h
-i  : inspect interactively after running script; 
      forces a prompt even if stdin does not appear to be a terminal;
      also PYTHONINSPECT=x