gpt4 book ai didi

python - 如何在 git bash 上使用 python

转载 作者:行者123 更新时间:2023-12-02 02:19:35 27 4
gpt4 key购买 nike

Python 不会在 git bash (Windows) 中运行。当我在命令行中输入 python 时,它会将我带到一个空行,而不会像在 Powershell 中一样显示它已输入 python 3.9.1。它没有给我错误消息,但 python 就是不运行。

这就是我输入 python 时发生的情况。它只是卡住了。关于如何修复它的任何想法。我无法使用命令提示符,因为当我导入显示 ModuleNotFound 的模块时,它会导致一些错误。

Selvi@DESKTOP-H75HFL5 MINGW64 /
$ python

2*2

最佳答案

要在 git bash 中运行 python,您只需输入 winpty python 或使用 python -i

注意:如果您使用 winpty python,您可以使用 CTRL + Zexit() 退出 python,但如果您使用 >python -i,只能使用exit()退出。

关于python - 如何在 git bash 上使用 python,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66625517/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com