Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invoking python under CygWin on Windows hangs

Tags:

python

cygwin

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?

like image 599
James Kanze Avatar asked Nov 27 '12 16:11

James Kanze


People also ask

How do I run a Python script in Cygwin?

Installing Python for Cygwin. Packages are installed for Cygwin using its setup utility, setup-x86_64.exe for 64-bit (source: http://cygwin.com/install.html). By default, the Cygwin setup utility asks for elevated Administrative permissions. These are not necessary to install and update the base Cygwin environment.

Can Cygwin use Windows Python?

Python can be run on a variety of platforms such as Windows, Unix and Linux. Cygwin is an open source tool that brings all the functionality from Linux to Windows, like a Linux emulator. If you'd like command line operation for programming run a Linux shell such as Cygwin on Windows to use Python.

How do I exit Python in Cygwin?

Show activity on this post. Try using Ctrl-D to exit instead.

How do I change python to Cygwin?

The fast way is to reorder your $PATH so that 2.5 is picked up first. The correct way is to use virtualenv to create a jail environment that's specific to a python version. Show activity on this post. As an addition to Bon's post, if you're not sand-boxing your not doing it right.


1 Answers

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 
like image 50
vikkyhacks Avatar answered Sep 22 '22 05:09

vikkyhacks