tags:

views:

39

answers:

3

I just installed Python 2.7, but IDLE is currently broken on OS X 10.6.4. Is there anyway I can revert to the earlier, Apple installed, version? A simple PATH adjustment, perhaps?

Right now $PATH looks like this for me:

/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin:
+1  A: 

/usr/bin/python is where Apple puts (the symlink to) the system version of Python -- so, just remove that first item from the PATH, and you should be fine.

Alex Martelli
A: 

If you want to continue to use Python 2.7, just replace it using the other, 32-bit only (10.3 and above) OS X installer available at the python.org download link. IDLE for 2.7 is only broken when using the 10.5 and above 64-bit installer; see Issue 9227.

If you really do want to remove Python 2.7 as your default Python, you'll need to undo the PATH change that the Python Installer makes by default to various shell login scripts, ~/.bash_profile or ~/.profile. It leaves the original files as ~/.bash_profile.pysave and ~/.profile.pysave. So you can compare them and just move the original back. For example, if your login shell is bash:

$ diff .bash_profile{,.pysave}   # does it look ok?
$ mv .bash_profile.pysave .bash_profile
Ned Deily
A: 

The default version is in /usr/bin, so just do a

export PATH=/usr/bin:$PATH

(Adjust the command according to your choice of shell)

It is simply a matter of setting the path. Look in /Library/Frameworks/Python.framework/Versions/ for the different versions

I have the following aliases in my .profile

alias python25="export PATH=/usr/bin:${PATH}"
alias python26="export PATH=/Library/Frameworks/Python.framework/Versions/2.6/bin:${PATH}"
alias pythonepd="export PATH=/Library/Frameworks/Python.framework/Versions/6.2/bin:${PATH}"

Switching between versions is then just a matter of a simple command.

shreddd