how to recover python 2.6.1 that was pre-installed in my macbook pro?
I download python 3.2 and my first thought was that I need to uninstall the python 2.6.1 pre-installed in my computer. But later I found in python.org "You should never modify or delete these, as they are Apple-controlled and are used by Apple- or third-party software". I used "sudo rm -rf /Library/Framework开发者_StackOverflows/Python.Framework" to delete python 2.6.1. Now I truly want to undo this command(I want python 2.6.1 back!). What should I do? (or the question can be expressed as follows: how can I re-install the pre-installed python 2.6.1 in my mac?)
Don't worry, that command will not remove it. The Apple-supplied Python in Mac OS X 10.6 is located at /System/Library/Frameworks/Python.framework
.
$ ls -l /usr/bin/python2.6
lrwxr-xr-x 1 root wheel 75 Nov 7 23:52 /usr/bin/python2.6@ -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6
Anything in /Library/Frameworks/Python.framework
was not put there by Apple, rather most likely by a python.org Python installer. The way to be sure is type:
$ /usr/bin/python2.6
Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
That's the signature of the current Apple-supplied Python 2.6 in Mac OS X 10.6.
In general, do not modify or delete files in /System/Library
or in /usr
other than /usr/local
. Files in /Library
are under your control.
Reinstalling would work. In the future, don't delete Frameworks you didn't install.
精彩评论