Installing python3.2 by default instead of python2.7 on mac osx lion 10.7.5

Mac OS X Lion 10.7.5 is currently running, and python2.7 is used by default. In the terminal, I write "python" and it automatically pulls up python2.7. I do not want it.

from the terminal, I should instead type 'python3.2' if I want to use python3.2.

How can I change this?

+6
source share
2 answers

The safest way is to set an alias in ~/.bashrc :

  alias python=python3 

This way you avoid breaking things for relaying scripts in python , which is python2.

+10
source

You can edit the default python path and point it to python3.2

Open ~/.bash_profile in the editor and edit it to look like

PATH="/Library/Frameworks/Python.framework/Versions/3.2/bin:${PATH}" export PATH

+3
source

All Articles