Python 3 不会从 Git Bash 命令行运行

标签 python git bash shell

<分区>

基本上,我在 Git Bash 命令行中输入 python,然后返回一个空白行,就好像命令行在思考...

我做了很多研究,但我似乎无法通过在命令行中输入 python 在 Git Bash 上运行 python。

我在看问题:Python not working in the command line of git bash 有人建议输入:

winpty c:/Python34/python.exe

进入命令行,它成功了!但是,我不想一直在命令行中键入整个命令。

最佳答案

"One caveat if using Git Bash with MinTTY: python doesn't go into interactive mode so a solution is to force it to start that way: echo alias python=\"python -i\" >> ~/.bash_profile"]

For more details

我遇到了同样的问题,使用“python -i”解决了它。

关于Python 3 不会从 Git Bash 命令行运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35471179/

相关文章:

python - 使用 setUpTestData 的 Django 测试不会保留测试之间的更改

android - Git/Github APK 失败

Git Init --Bare Error - fatal : Out of memory? mmap 失败:没有这样的设备

bash - 让ssh在目标机器的后台执行命令

python - Python BeautifulSoup 中的 CSS 选择器

python - Delphi - 映射函数意外输出

python - python 中的汉诺塔,代码为 "counter"

git - 使用 git rebase 时如何让下一次提交应用?

linux - 如何在 Bash 脚本中将字符串作为参数传递给 AWK

linux - 动态获取由 docker run 命令创建的正在运行的容器 ID/名称