Install Python3 in OS X

In OS X, we have original python. However, we might need python3 sometimes. What could we do…

Firstly, you need homebrew. And you can get the information from my another article.

And you can download python3 with command as ‘brew install python3’. Python3 will be installed in /usr/local/Cellar.

Remember the path. This is the point that how we make python and python3 exist at the same time.

The default searching path is as following,

/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin

Do you remember that python3 is under /usr/local but python is under /usr? So we need to move /usr/local/bin higher than /usr/bin to make it get higher searching priority.

sudo emacs /etc/paths

we can use “echo $PATH” to check the settings. Remember to open a new terminal to update the new settings.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.