How to use python on gitbash

Python will not run in git bash (Windows). When I type python in the command line, it takes me to a blank line without saying that it has entered python 3.9.1 like it does in Powershell. It doesn't give me an error message, but python just doesn't run.

This is what happens when I type python. It just freezes. Any Idea on how to fix it. I cannot use command prompt because it causes some error when I import a module it says ModuleNotFound.

Selvi@DESKTOP-H75HFL5 MINGW64 /
$ python

2*2

Upvotes: 3

Views: 10389

Answers (2)

Actually I was having the same problem. The only thing is that when you enter the Python command prompt with python -i, you can only exit it with quit()

Upvotes: 0

brutus314
brutus314

Reputation: 96

Getting python run in git bash you simply can type winpty python or you can use python -i

Note: if you use winpty python you can exit python with CTRL + Z or exit(), but if you used python -i, you only can exit with exit().

Upvotes: 8

Related Questions