Reinstall /Library/Python on OS X Leopard

痞子三分冷 提交于 2019-12-13 04:22:25

问题


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


回答1:


/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




回答2:


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




回答3:


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



来源:https://stackoverflow.com/questions/917876/reinstall-library-python-on-os-x-leopard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!