简体   繁体   中英

Reinstall /Library/Python on OS X Leopard

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

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.)

/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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM