相关疑难解决方法(0)

Python无法在git bash的命令行中运行

Python不会在git bash(Windows)中运行.当我在命令行中键入python时,它将我带到一个空白行,而不是说它已经像在Powershell中那样输入了python 2.7.10.它没有给我一个错误消息,但python只是不运行.

我已经确定了PATH中的环境变量c:\python27.我还能检查什么?


发生此问题的会话如下所示:

user@hostname MINGW64 ~
$ type python
python is /c/Python27/python

user@hostname MINGW64 ~
$ python
Run Code Online (Sandbox Code Playgroud)

......坐在那里而不回到提示.

python windows git command-line git-bash

192
推荐指数
11
解决办法
11万
查看次数

在 git bash 中使用 python json.tool 时出现“stdin is not a tty”错误

我在 Windows 上使用 Git Bash,尝试使用命令行漂亮地打印 JSON 输出。根据这个答案,我尝试以下操作:

$ echo '{"print": "this"}' | python -m json.tool
stdin is not a tty
Run Code Online (Sandbox Code Playgroud)

我的Python版本是2.7.15(Anaconda)。

当我使用本机 Windows cmd 尝试相同的操作时,它可以正常工作(但我想使用 Bash)。

windows tty python-2.7 git-bash

4
推荐指数
1
解决办法
6001
查看次数

标签 统计

git-bash ×2

windows ×2

command-line ×1

git ×1

python ×1

python-2.7 ×1

tty ×1