Question

I accidentally removed /Library/Python on OS X Leopard. How can I reinstall that?

Was it helpful?

Solution

/Library/Python contains your python site-packages, which is the local software you've installed using commands like python setup.py install. The pieces here are third-party packages, not items installed by Apple - your actual Python installation is still safe in /System/Library/etc...

In other words, the default OS leaves these directories mostly blank... nothing in there is critical (just a readme and a path file).

In this case, you'll have to :

  1. Recreate the directory structure:

  2. Re-install your third-party libraries.

The directory structure on a default OS X install is:

/Library/Python/2.3/site-packages /Library/Python/2.5/site-packages

OTHER TIPS

If you'd like, I'll create a tarball from a pristine installation. I'm using MacOSX 10.5.7, and only 12K.

I'm using 10.4, but unless the installation changed dramatically in 10.5, /Library/Python is just a place to install local (user-installed) packages; the actual Python install is under /System. On 10.4, I have the following structure:

/Library/
    Python/
        2.3/
            README
            site-packages/
                README

So just re-creating that structure may suffice. (But instead of 2.3, use the version of Python installed on 10.5.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top