

I removed every version of Python (3x and 2x), downloaded the official installer here, installed 3.8.5 fresh (just used the defaults) which installed Python 3.8.5 at this location:Ĭ:\Users\(my username)\AppData\Local\Programs\Python\Python38

Somehow I had several different 2.7x versions of Python installed as well. I know this is an old post, but I just came across this problem on Windows 10 running Python 3.8.5 and Git 2.28.0.windows.1 $ ll -> enters a ls -lah to quickly show your detailed file list Now, permanently you could launch both Python directly from Git shell just writting I modified also the ll alias to show all the files and in a human readable list: alias ll='ls -lah'ĥ) OK!!! close and relaunch your Git Bash So add these lines at the beginning of aliases.sh alias python2='winpty C/Networking/"Network Automation"/"Python 2.7"/python.exe'Īlias python='winpty C/Networking/"Network Automation"/"Python 3.7"/python.exe'ģ) Add or Modify other aliases (if you want) Winpty is the magic command that will call the executable. Git Bash uses linux file structure so you need to change the "\" for "/"Īnd if you have a path like my example Network Automation you put it with " " So you must create 2 aliases, one for Python 2 ( I named python2) and the other for Python 3 ( I named just python) In my case the python.exe are installed in: C:\Networking\Network Automation\Python 2.7\python.exeĬ:\Networking\Network Automation\Python 3.7\python.exe It is located in:Ĭ:\path where you installed Git\etc\profile.d\aliases.sh 1) Open (with a text editor like Atom or other) the aliases.shįor ex: in my case the file is in C:\Software\Develop\Git\etc\profile.d\aliases.sh 2) Add your alias for Python This is (for me) the best solution to run both Python (Python 2.7 and Python 3.x) directly from Git Bash on Win 10 => adding aliases into the aliases file that Git Bash uses for. Git Bash Workaround- Launch Python 2 & Python 3 with aliases See more here: Git for Windows doesn't execute my. Conda also uses this profile when initializing, so be sure not to overwrite or delete the initialization block. To apply the change, either use the command source. bashrc in your prefered text editor and add it there. Depending on your file manager, this may be easier to accomplish in git bash like so: cd ~Īt which point you can open. Using a text editorĪlternatively, you could first create a.

bashrc in the current users home directory if the file doesn't exist or append the alias to the end of. This can be accomplished from git bash like so: echo "alias python='winpty python.exe'" > ~/.bashrc You can use the CLI or a text editor: Using CLI Permanent solutionĪdd the command to your.
#Git bash windows 10 ctrl c not working software
Winpty is a Windows software package providing an interface similar to a Unix pty-master for communicating with Windows console programs. This alias will be valid for the duration of the shell session. Just enter this in your git shell on windows - > alias python='winpty python.exe', that is all and you are going to have alias to the python executable.
