Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 260
Kaushik Jayendirakumar Avatar asked Sep 24 '26 03:09

Kaushik Jayendirakumar


1 Answers

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().

like image 159
brutus314 Avatar answered Sep 25 '26 18:09

brutus314