views:

83

answers:

2

I was wondering if anyone had tips on how to completely remove a python installation form Mac OSX (10.5.8) ... including virtual environments and its related binaries. Over the past few years I've completely messed up the installed site-packages, virtual-environments, etc. and the only way I can see to fix it is to just uninstall everything and re-install.

I'd like to completely re-do everything and use virtualenv, pip, etc. from the beginning.

On the other hand if anyone knows a way to do this without removing python and re-installing I'd be happy to here about it.

Thanks,

Will

A: 

You should be able to delete the packages you've installed from /Library/Python/2.*/site-packages/. I do not think any package installers will install by default to /System/Library, which should save you from needing to remove Python itself.

That said, you could also use virtualenv with --no-site-packages, and just ignore whatever packages you've installed system-wide without needing to remove them.

Joseph Spiros
The problem is that when I do things like `pip install` or `easy_install` they don't end up in the actual python installation. ie `pip install numpy` succeeds but a subsequent `import numpy` fails Whether I'm doing them in `virtualenv`, base-distribution, etc. I'm thinking I've got the symlinks messed up somehow.
JudoWill
+1  A: 

Just for everyone else's reference. I found this in the Python documentation here:

Mac OS X 10.5 comes with Python 2.5.1 pre-installed by Apple. If you wish, you are invited to install the most recent version of Python from the Python website (http://www.python.org). A current “universal binary” build of Python, which runs natively on the Mac’s new Intel and legacy PPC CPU’s, is available there.

What you get after installing is a number of things:

* A MacPython 2.5 folder in your Applications folder. In here you find

IDLE, the development environment that is a standard part of official Python distributions; PythonLauncher, which handles double-clicking Python scripts from the Finder; and the “Build Applet” tool, which allows you to package Python scripts as standalone applications on your system. * A framework /Library/Frameworks/Python.framework, which includes the Python executable and libraries. The installer adds this location to your shell path. To uninstall MacPython, you can simply remove these three things. A symlink to the Python executable is placed in /usr/local/bin/.

I removed these and the virtualenv directories. Then I re-installed everything and its working fine now.

JudoWill