LoginSignup
4
4

More than 5 years have passed since last update.

Windows の Git Bash で Python の REPL が起動しないことへの対処法

Posted at

Windows の Git Bash で Python の REPL が起動しなくてハマったので、その対処法です。

検証に使った環境

Windows 10 Home
Git for Windows v2.13.1
Python 3.6.2

問題と対処法

Git Bash で

$ python 

と打っても REPL が起動せず、止まったまま。
なぜだと思ってググったら

$ winpty python.exe

のように実行すれば動くとのこと。
実際にやってみて動いた。

お好みなら、
.bashrc に
alias python='winpty python.exe'
の行を追加するとよいとのこと。

マジか・・・。全然知らなかった。

参考

[windows - Python not working in the command line of git bash - Stack Overflow]
https://stackoverflow.com/questions/32597209/python-not-working-in-the-command-line-of-git-bash

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4