简体   繁体   中英

Python 2.7 not loading in Cygwin

I'm having an issued getting my install of python27 to load correctly in Cygwin. My install has 2.6 (/bin/python@ ) on it, but I'd like the default Python environment to be 2.7 ( /cygdrive/c/Python27/python.exe ). I know how to change my $PATH and all, but when I try to run this 2.7 installation through Cygwin by going to its directory and typing python it never loads; I have to end the command with CTRL-c. Is this a Cygwin problem, a Windows problem, or a me problem?

I think you can find some answers in this other question .

It is rather a problem of using the Windows version of Python with the Cygwin terminal.

Quick summary:

  • for interactive mode, add the -i option
  • if you want to see the output of your script, add the -u option.

I faced the same problem with Python 2.7 on Cygwin. Launching Python with -i option did get me to the interpreter, but it would not allow the use of the "up" cursor key to repeat older commands.

What you need to do is to launch the /bin/bash.exe from a DOS prompt. This will launch the standard Windows console instead the Cygwin console.

This answer sums it up pretty well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM