My Mac came with Python 2.7 installed by default, but I'd like to use Python 3.6.1 instead.
How can I change the Python version used in Terminal (on Mac OS)?
Please explain clearly and offer no third party version manager suggestions.
Yes, you should be able to switch between python versions. 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.
The default Python interpreter is referenced on Windows using the command py. Using the Command Prompt, you can use the -V option to print out the version. You can also specify the version of Python you'd like to run. For Windows, you can just provide an option like -2.7 to run version 2.7.
The simplest way would be to add an alias to python3
to always point to the native python
installed. Add this line to the .bash_profile
file in your $HOME
directory at the last,
alias python="python3"
Doing so makes the changes to be reflected on every interactive shell opened.
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