【问题标题】:How to use python on gitbash如何在 git bash 上使用 python
【发布时间】:2021-06-11 23:35:45
【问题描述】:

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

这就是我键入 python 时发生的情况。它只是冻结。关于如何解决它的任何想法。我无法使用命令提示符,因为当我导入一个显示为 ModuleNotFound 的模块时会导致一些错误。

Selvi@DESKTOP-H75HFL5 MINGW64 /
$ python

2*2

【问题讨论】:

    标签: python windows freeze git-bash


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2021-05-28
      • 2018-03-23
      • 2022-08-13
      • 1970-01-01
      • 2018-02-14
      • 2017-01-18
      • 2017-09-05
      • 1970-01-01
      • 2021-02-13
      相关资源
      最近更新 更多