在 Mac OS X 10.6 上重新安装 Python 2.6

发布于 2024-11-17 08:43:35 字数 466 浏览 0 评论 0 原文

很久以前,我删除了包含内置 Mac OS X Python 安装的 2.6 目录,现在我需要将其恢复。如何重新编译 Python 并将其安装到原始位置?

诸如 FinkbrewMacPorts 都是我所知道的的,但如果他们能够解决我的问题,我不知道如何以这种方式使用它们。我需要将安装安装在原始位置(/System/Library/Frameworks/Python.framework/Versions)并像原来一样工作。

Quite a while back I deleted the 2.6 directory that contained the built in Mac OS X Python install, and now I am in need of having it back. How might one go about re-compiling and installing Python to the original location?

Solutions like Fink, brew, and MacPorts are all things I'm aware of, but if they are capable of solving my problem I don't know how to use them in that fashion. I need the install to be in the original location (/System/Library/Frameworks/Python.framework/Versions) and to work as it originally did.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

天生の放荡 2024-11-24 08:43:35

最简单的解决方案是在现有安装上重新安装 OS X 10.6。正如评论中所指出的,构建 Apple 提供的 Python 系统的精确副本是不切实际的,因为有大量的 Apple tweeks,尽管其中许多是由 Apple 此处(您可以深入了解特定的 OS X 版本,并找到其中包含的开源组件以及 Apple 提供的补丁)。但 OS X 安装程序可以轻松且万无一失地重新安装所有 OS X,而不会影响主目录中的文件或大多数记录的自定义项。如果您对 /System/Library/usr/usr/local 除外)中的文件进行了其他更改或删除,那么一切都将失败。 >);正如您所了解到的,不要这样做!与往常一样,在开始之前对硬盘进行完整备份是明智的做法。重新安装不会超过几个小时,这比尝试从源代码重新创建系统 Python 要少得多。

The simplest solution is to reinstall OS X 10.6 over your existing installation. As noted in the comments, it's not practical to build an exact duplicate of the Apple-supplied system Python because of the numerous Apple tweeks although many of them are published by Apple here (you can drill down to a particular OS X release and find the open source components that went into it along with the Apple-supplied patches). But the OS X installer makes it easy and generally foolproof to reinstall all of OS X without affecting files in your home directories or most documented customizations. All bets are off if you've made other changes or deletions to files in /System/Library or /usr (other than /usr/local); as you've learned, don't do that! As always, it is prudent to do a full backup of your hard drive before you begin. A reinstall shouldn't take more than a couple of hours which will be a lot less time than trying to recreate the system Python from source.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文