Upgrading from Python 2.6 to 2.7 isn't working

Using a mac 10.6, I tried downloading and installing python 2.7. Although the installer finished, and python 2.7 is in the Applications folder, the framework folder still hasn't changed, and the latest is 2.6.

When I run a python script I right-click to choose Python Launcher(2.7)(default), but I've included the lines

import sys
print(sys.version)

In my script, and that shows

2.6.2 (r262:71600, Apr 16 2009, 09:17:39) 
[GCC 4.0.1 (Apple Computer, Inc. build 5250)

What's going on?

ALSO IDLE 2.7 isn't working (claiming connection is blocked), but 2.6 does.


Solution 1:

It's dangerous to upgrade your preinstalled Python because some Mac programs rely on that specific version. You should use ActivePython so that you don't break dependencies. And to start it, type:

python2.7

in the Terminal.

Solution 2:

You can always alias it through your terminal settings or your .bash settings file so that every time you run the command python terminal runs python2.7 instead.

Type alias python='python2.7' into your terminal to get started.