I\'m running Mountain Lion and the basic default Python version is 2.7. I downloaded Python 3.3 and want to set it as default.
Currently:
$ python
This worked for me. I added alias and restarted my terminal:
alias python=/usr/local/bin/python3
The following worked for me
cd /usr/local/bin
mv python python.old
ln -s python3 python
You can solve it by symbolic link.
unlink /usr/local/bin/python
ln -s /usr/local/bin/python3.3 /usr/local/bin/python
I believe most of people landed here are using ZSH thorugh iterm or whatever, and that brings you to this answer.
You have to add/modify your commands in ~/.zshrc
instead.
The RIGHT and WRONG way to set Python 3 as default on a Mac
In this article author discuss three ways of setting default python:
All these ways are working. You decide which is better.
If you are using macports, that has a easier way to do:
run:
port install python37
after install, set default:
sudo port select --set python python37
sudo port select --set python3 python37
restart your cmd window, finished.