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)
......坐在那里而不回到提示.
我在 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)。