Reputation: 123
I tried installing python 2.7.4 by overwriting the native Apple's installation of python 2.7 by following this link (wolfpaulus.com), and as a result both easy_install and pip no longer work.
This link (apple.com) suggests the native Apple bundle should never be deleted.
Is it possible to restore python 2.7 supplied by Apple without reinstalling OSX? Is there a definitive guide to upgrading python to 2.7.4 on OSX Lion? For instance, before breaking my set up I could install bumpy, django into 2.7.4, but matplotlib refused to install to anything but 2.7, either from binaries or source.
Thanks.
Upvotes: 3
Views: 2133
Reputation: 85035
You should never remove anything in /System/Library
or /usr
(other than /usr/local
). Files installed in those locations are managed by Apple as part of OS X. At worst you can fatally damage your OS X system; at best you are at risk of all of your changes being wiped out by the next software update. In particular with Python, you’ve just wiped out Apple-supplied extensions to Python that are not available elsewhere. The right way to update a system component like Python is to install the new version at a different location, like the python.org Python installers do in /Library/Frameworks
, and then manage access by modifying your shell PATH
environment variable. Unfortunately, Apple does not make it easy to install individual components of OS X that have been mistakenly removed. To properly restore all of the system Python that you've deleted, the easiest approach is to reinstall OS X itself.
When you install another version of Python, you should also use it to install additional versions of pip
or easy_install
. Generally, each Python version should have its own version of each.
Upvotes: 2
Reputation: 239
It is absolutely not a good idea to replace Apples default python installation. If you have done, then you could try with the following command
" brew install python --framework "
R
Upvotes: 2