1

我有一个问题,让我安装的 python27 在 Cygwin 中正确加载。我的安装有 2.6 (/bin/python@ ),但我希望默认 Python 环境为 2.7 ( /cygdrive/c/Python27/python.exe)。我知道如何更改我的 $PATH 和所有内容,但是当我尝试通过 Cygwin 运行这个 2.7 安装时,转到它的目录并输入python它永远不会加载;我必须用 CTRL-c 结束命令。这是 Cygwin 问题、Windows 问题还是我的问题?

4

2 回答 2

2

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.
于 2012-04-27T20:15:38.823 回答
1

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.

于 2012-12-01T19:33:17.360 回答