tags:

views:

109

answers:

3

I wanted to update my python 2.6.1 to 3.x on mac but i was wondering if its possible to do it using terminal or i have to download the installer from python website?

The reason why i am asking this question is because installer is not updating my terminal python version.

A: 

I believe Python 3 can coexist with Python 2. Try invoking it using "python3" or "python3.1". If it fails, you might need to uninstall 2.6 before installing 3.1.

yk4ever
+3  A: 

The default Python on OS X shouldn't be messed with as it's used by the OS itself. If your default is 2.6.1 then you must have Snow Leopard.

If you just install from the standard 3.1 disk image then you can invoke it using python3.1 from the terminal (you don't have to do any extra steps for this to work) and you can leave the plain python as 2.6.1.

Scott Griffiths
Can i type python3.1 in terminal?
itsaboutcode
Yes, it should work from the terminal with no extra steps.
Scott Griffiths
Hmm its working on terminal, thanks.
itsaboutcode
A: 

I personally wouldn't mess around with OSX's python like they said. My personally preference for stuff like this is just using MacPorts and installing the versions I want via command line. MacPorts puts everything into a separate direction (under /opt I believe), so it doesn't override or directly interfere with the regular system. It has all the usually features of any package management utilities if you are familiar with Linux distros.

I would also suggest installing python_select via MacPorts and using that to select which python you want "active" (it will change the symlinks to point to the version you want). So at any time you can switch back to the Apple maintained version of python that came with OSX or you can switch to any of the ones installed via MacPorts.

Sean Copenhaver