[Pythonmac-SIG] How to remove Python from my Mac?

Russell E. Owen rowen at u.washington.edu
Sat Apr 25 01:13:55 CEST 2009


In article 
<91f48dbf0904241533k3722b56au56bb7726eed30229 at mail.gmail.com>,
 Ethan Herdrick <info at reatlas.com> wrote:

> Hi - I'm getting started with Python and am getting ImportError
> trouble with the first step of the very simple tutorial for web.py.
> I'm suspecting that the fact that I have two installations of Python -
> one that my Mac came with and one that I installed from
> python-2.6.2-macosx2009-04-16.dmg which I got from
> python.org/download/ - might be the problem.
> 
> Also, in trying to get this thing going I was fiddling with the
> install_lib setting in .pydistutils.cfg and left it in a modified
> state before running setup.py on a module, so the module ended up in a
> strange location.
> 
> Anyway, I'd really be happier if I could wipe all python stuff -
> including things like easy_install - from my machine so I can just
> start over.  This seems to be harder than it sounds.  True?  And how
> do I do this?

Wiping the user-installed python is easy. Just delete:
/Library/Frameworks/Python.Framework

To do this from terminal you can type:
rm -rf /Library/Frameworks/Python.Framework

Note that you can also delete just a particular version if python if you 
have more than one -- just look in the directory mentioned above.

This may leave some symlinks in /usr/local/bin, but if you plan to 
install a fresh python you can ignore them because they will get 
overwritten. Otherwise look for python* and in the case of Python 2.6, 
also *2to3*

If you messed up your system python, that can be harder, but at least 
user-installed packages that were properly installed are easy to remove. 
Look in /Library/Python/2.3/site-packages/
(e.g. in Terminal type "open /Library/Python/2.3/site-packages")
and remove everything except ReadMe and Extras.pth
Then you can look at Extras.pth and make sure it only has one line that 
points somewhere in /System
(you can delete any additional lines).

For some reason I found I also have /Library/Python/2.5; not sure where 
that came from but it is basically empty (just contains 
site-packages/README). You might want to look for the 2.6 version and 
make sure it is basically empty.

-- Russell



More information about the Pythonmac-SIG mailing list