I've installed python 3.5 and python 2.7 on windows. And I've added path for python 2.7 in PATH variable. When I type 'python --version' in windows cmd, it prints 2.7. But when i type 'python --version' in git bush, it prints 3.5. How to change python version in windows git bash to 2.7?
As a standard, it is recommended to use the python3 command or python3. 7 to select a specific version. The py.exe launcher will automatically select the most recent version of Python you've installed. You can also use commands like py -3.7 to select a particular version, or py --list to see which versions can be used.
Follow these steps:
cd ~
touch
, code
or vim
(in my case) type code .bashrc
alias python='winpty c:/Python27/python.exe'
to the open .bashrcpython --version
on git bash again.Hopefully it works for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With