3

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.

4

2 回答 2

2

您永远不应该删除/System/Libraryor中的任何内容/usr(除了/usr/local)。安装在这些位置的文件由 Apple 作为 OS X 的一部分进行管理。在最坏的情况下,您可能会致命地损坏您的 OS X 系统;充其量,您的所有更改都可能会被下一次软件更新抹去。特别是对于 Python,您刚刚清除了 Apple 提供的 Python 扩展,而这些扩展在其他地方是不可用的。更新像 Python 这样的系统组件的正确方法是将新版本安装在不同的位置,就像 python.org Python 安装程序在 中所做的那样/Library/Frameworks,然后通过修改你的 shell 来管理访问PATH环境变量。不幸的是,Apple 无法轻松安装被错误删除的 OS X 的各个组件。要正确恢复已删除的所有系统 Python,最简单的方法是重新安装 OS X 本身。

当您安装另一个版本的 Python 时,您还应该使用它来安装其他版本的pipeasy_install. 通常,每个 Python 版本都应该有自己的版本。

于 2013-04-13T17:43:11.297 回答
2

替换苹果默认的python安装绝对不是一个好主意。如果你已经完成了,那么你可以尝试使用以下命令

“ brew install python --framework ”

R

于 2013-04-13T17:17:43.083 回答