小编Jus*_*tin的帖子

Git-Bash 未按预期运行 Python3,挂起问题

我将尽量描述性但尽可能简短......

过去我一直在 Win10 上成功使用 GitBash。我在一段时间不使用它之后又回到了我的 Windows 机器上,似乎无法让它启动以前没有问题运行的 python 脚本。我为 Python3 创建了一个别名,名为 py。例如...

$ py --version
Python 3.7.1
Run Code Online (Sandbox Code Playgroud)

我可以很好地进入迭代器

$ py -i
Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
Run Code Online (Sandbox Code Playgroud)

我可以在迭代器中很好地运行我的脚本。但是,使用 ctrl+z 退出会引发错误。结合此错误,当我尝试从命令行运行 scipts 时,它挂起并且没有响应。见下文...

$ py -i
Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>       0 [sig] bash …
Run Code Online (Sandbox Code Playgroud)

linux python python3 git-bash windows-10

2
推荐指数
1
解决办法
6177
查看次数

标签 统计

git-bash ×1

linux ×1

python ×1

python3 ×1

windows-10 ×1