classification
Title: Missing uninstallation instructions for mac
Type: enhancement Stage: resolved
Components: Installation, Macintosh Versions: Python 3.1, Python 3.2, Python 2.7, Python 2.6
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: ronaldoussoren Nosy List: gradha, ned.deily, ronaldoussoren
Priority: normal Keywords:

Created on 2009-10-11 19:59 by gradha, last changed 2010-04-30 15:14 by ronaldoussoren. This issue is now closed.

Messages (4)
msg93873 - (view) Author: Grzegorz Adam Hankiewicz (gradha) Date: 2009-10-11 19:59
I've installed the official 2.6.3 dmg file of python and now want to 
uninstall it to revert to the python version included by default by the 
OS. I would do so if I knew what I have to remove or change.
msg93882 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2009-10-11 23:44
As far as I know, there is no documented way to totally install a 
python.org OS X installation and the OS X installer does not provide a 
general way to uninstall a package.  So it would be nice for the Python 
installer to provide some sort of uninstall script.

In the meantime, if you just want to temporarily revert, you can modify 
your .bash_profile or other login shell initialization to fix $PATH to 
not add "/Library/Frameworks/Python.framework/Versions/2.6/bin" to $PATH 
(you'll probably find this was added at the end of .bash_profile by the 
installer or by "Update Shell Profile.command") and/or to not have 
/usr/local/bin appear before /usr/bin on $PATH.

If you want to permanently remove the python.org installed version, 
paste the following lines up to and including the chmod into a posix-
compatible shell:

tmpfile=/tmp/generate_file_list
cat <<"NOEXPAND" > "${tmpfile}"
#!/bin/sh
version="${1:-"2.6"}"
file -h /usr/local/bin/* | grep \
"symbolic link to ../../../Library/Frameworks/Python.framework/"\
"Versions/${version}" | cut -d : -f 1
echo "/Library/Frameworks/Python.framework/Versions/${version}"
echo "/Applications/Python ${version}"
set -- Applications Documentation Framework ProfileChanges \
         SystemFixes UnixTools
for package do
  echo "/Library/Receipts/Python${package}-${version}.pkg"
done
NOEXPAND
chmod  ug+x ${tmpfile}

----

The shell script writes to its standard output a list of files and top-
level directories that should be removed.  You can examine the list by 
just running the script:

  ${tmpfile} 2.6

To actually delete the files:

  ${tmpfile} 2.6 | sed -e "s/^.*$/sudo rm -r \"&\"/g" | sh

You will still have to manually edit your .bash_profile script as above.  
Another minor loose end is that the script does not attempt to modify 
the frameworks "Versions/Current" symlink but I don't know of anything 
that depends on that.
msg94205 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2009-10-18 07:14
The root cause for this issue is Apple's broken installer system: Apple 
does have a package installer, but does not provide tools to uninstall 
packages. 

I'm reluctant to provide an uninstaller as part of the Python project, 
such a tool would require serious testing to ensure that it doesn't 
accidentally remove too much.
msg104645 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2010-04-30 15:14
I've added some notes to Mac/README.

r80657 (trunk)
r80658 (2.6)
r80659 (3.2)
r80660 (3.1)
History
Date User Action Args
2010-04-30 15:14:17ronaldoussorensetstatus: open -> closed
resolution: accepted
stage: resolved
2010-04-30 15:14:01ronaldoussorensetmessages: + msg104645
2009-10-18 07:14:40ronaldoussorensetmessages: + msg94205
2009-10-11 23:44:22ned.deilysetversions: + Python 3.1, Python 2.7, Python 3.2
nosy: + ronaldoussoren, ned.deily

messages: + msg93882

assignee: ronaldoussoren
components: + Macintosh
2009-10-11 19:59:57gradhacreate