Install Python 3 on OSX

Even the the latest version of OSX ships with Python 2.7 which is getting a bit long in the tooth and Python 3.x is where its at these days. Although I wish most Python library developers would update their systems. Its not that hard

Anyway, download the latest version, in this instance Python 3.3

http://www.python.org/getit/

I went with the 64 bit version as default. Run the installer once downloaded and you have 3.3 installed but from the command line, it still shows 2.7, so we need to tell the shell to use Python 3.

Edit ~./bash_rc and add the following 2 lines

alias python=python3
PATH="/Library/Frameworks/Python.framework/Versions/3.3/bin:${PATH}" export PATH

If we want to do anything interesting with Python we will need pip, the pack installer. Get this with the following command

curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python3

You can check its installed and working with Python 3 with the following

pip --version

Which should should something line the following

pip 1.5.2 from /Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages (python 3.3)

Which shows you are running pip on the latest version of Python you just installed

Your email address will not be published. Required fields are marked *