What to do if Python doesn't work on Git for Windows

Since Git for Windows went up to 2 series, the commands handled in interactive mode such as python with the attached Git Bash did not work well.

This seems to be a known bug (or specification?) Of MinTTY used in Git Bash, and it seems that commands with interactive mode can use winpty. In other words, if you start python on Git Bash as follows, it will work normally.

winpty python

If you have to add winpty one by one, or if you are tired of it, you can also modify <Git installed folder> \ etc \ profile.d \ aliases.sh. If you add the command you want to use via winpty to for name in ..., it's OK.

aliases.sh


	for name in node ipython php php5 psql python2.7 python
	do
		alias $name="winpty $name.exe"
	done

There seems to be for some reason about why not do this in the first place, but I couldn't understand it even after reading it. (Because I have to distinguish whether it is Python of MSys2, but there is a way to distinguish it, it seems like a mystery). If you're worried, ʻipython` is officially included in 2.6.3, so if you want to go into interactive mode, you can use ipython (because it's also functionally richer). ..

reference

Recommended Posts

What to do if Python doesn't work on Git for Windows
What to do if PyAudio cannot be installed on Python 3.7, 3.8, 3.9 on Windows
What to do if rails s doesn't work
What to do if atom autocomplete-python doesn't work
What to do if scrapy doesn't work after installing scrapy with pip on mac
What to do if the Microsoft Store opens even if you run python on Windows
What to do if Python IntelliSense is not displayed in VS Code on Windows
What to do if intellisense doesn't work with Anaconda + VSCode + Tensorflow2.1
What to do if No Python documentation found for ... appears in pydoc
What to do if the server doesn't start with python manage.py runserver
What to do if SciPy installation fails on CentOS
Let's Encrypt updated! What to do if the certbot renew command doesn't work
What to do if you installed pyenv on Mac OS using Homebrew but the python version doesn't switch
What to do if "export" keeps appearing on terminal when trying to put Python on macOS
What to do when python3 type venv does not work well on Raspberry Pi
What to do if you get `No kernel for language python found` in Hydrogen
What to do if you are addicted to Windows character code
What to do if `pip install matplotlib` fails on Mac
What to do if you can't use WiFi on Linux
What to do if pip install mysqlclient fails on MacOS
Python 3.6 on Windows ... and to Xamarin.
What to do with PYTHON release?
What to do to get tensorflow-gpu to work
What to do if you can't install pyaudio with pip #Python
What to do if you get a minus zero in Python
What to do if python says "fatal error:'stdio.h' file not found"
What to do if Insecure Platform Warning appears when running Python
What to do if the inode is exhausted on EC2 Linux
What to do if grep: empty (sub) expression appears on Mac grep
Notes for using OpenCV on Windows10 Python 3.8.3.
[Kivy] How to install Kivy on Windows [Python]
Virtualenv does not work on Python3.5 (Windows)
What to do if there is a decimal in python json .dumps
What to do if you couldn't send an email to Yahoo with Python.
What to do if you can't use scikit grid search in Python
What to do if ipython and python start up with different versions
What to do if you forget your login password on Manjaro Linux
What to do if you get stuck during Anaconda installation on Linux
What to do if the Chainer (Windows) sample mnist terminates with WinError 183.
Notes on what to do when matplotlib scatter () / scatter3d () does not work
Python on Windows
Put MicroPython on Windows to run ESP32 on Python
What to do if pipreqs results in UnicodeDecodeError
What to do if you can't pipenv shell
[Python] What I did to do Unit Test
Note: What to do if pip install fails
What to do if mod_fcgid cannot resolve UnicodeEncodeError
[For beginners] What to do after installing Anaconda
What to do if pip cannot be installed
I want to do pyenv + pipenv on Windows
[Python] How to install OpenCV on Anaconda [Windows]
What to do to get google spreadsheet in python
What to do if Docker-sync suddenly stops working
Installing TensorFlow on Windows Easy for Python beginners
What to do if "amazon-linux-extras" → "No module named amazon_linux_extras"
Steps to build PyTorch 1.5 for CUDA 10.2 on Windows
[Python] What to do if an error occurs in pip (pyinstaller, pyautogui, etc.)
What to do if CERTIFICATE_VERIFY_FAILED occurs when nltk.download () is done on macOS pyhon
What to do if the latest Jupyter Notebook and nb extensions don't work
What to do if a Unicode Encode Error occurs in Sublime Text Python
What to do if you get an error when installing python with pyenv