Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a MacBook that came with Python 2.5 installed. I need use a newer version, so I downloaded 3.1 and installed it, then ran the "Update Profile Script" that came with it, which is supposed to change the default version of Python to the one I downloaded. It appeared to run fine and said process completed, but it didn't work. When I type "python" into the terminal it displays version 2.5, and I still can't install pygame, which requires at least Python 2.6.

When I do vi .profile I get this:

export PATH=.:/opt/local/bin:/opt/local/sbin:$PATH

export MANPATH=/opt/local/man:$MANPATH

# Setting PATH for Python 3.1

# The orginal version is saved in .profile.pysave

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

export PATH

So it looks like the script did do something, but I don't know enough bash script to understand what. Does anyone know what the issue could be or how to fix it?

share|improve this question
    
Holy formatting! –  squircle Jun 1 '10 at 20:44
    
If you type in "which python" what do you get back? It looks like it prepended the python 3.1 bin folder to your PATH, which is correct since just typing "python" will execute the first one in the PATH. –  Taylor Leese Jun 1 '10 at 20:46
    
I get /usr/bin/python –  Emma Jun 1 '10 at 20:58
    
possible duplicate of Using Python on Mac –  Daniel Beck Jan 29 '11 at 11:44

1 Answer 1

First, it's not safe to assume that something that requires Python 2.6 or newer will run on Python 3.1. The python docs say "Python 3.0 ... is the first ever intentionally backwards incompatible Python release." (Edit: Pygame 1.9 does work with Python 3, but not all modules have been ported)

If you're running OS X Snow Leopard (10.6), you have python 2.5 and 2.6 installed. To switch to use 2.6 by default, open a Terminal window and enter:

defaults write com.apple.versioner.python Version 2.6

If you're not running Snow Leopard, you will need to install a newer version. The easiest way would probably be to go to the download page for the latest 2.6 version (currently 2.6.5) and download and installed the "Mac Installer disk image"

share|improve this answer
    
That works perfectly, thanks! –  Emma Jun 1 '10 at 21:19
    
works with Xcode4 as well –  Alexander Orlov May 11 '11 at 19:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.