如何在 OSX 上恢复默认的 python 安装?

发布于 2024-10-08 20:45:54 字数 623 浏览 1 评论 0原文

我尝试在运行 OSX 10.6 的 Mac 上安装 pyobjc (使用 pyobjc-1.2-python2.3-macosx10.2.dmg),但收到以下错误消息:

alt text

要使用Python 2.3,我尝试重新编辑我的.bash_profile,并注释掉除此行之外的所有内容:

# change python version 
defaults write com.apple.versioner.python Version 2.3

我之前确实包含了这一行:

PATH="/Library/Frameworks/Python.framework/Versions/2.3/bin:/usr/bin:/bin${PATH}"
export PATH

但目前将其排除在外。我知道当我在终端中输入 python 时,它会给我 Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29) 所以它显然是不使用2.3。

我可以做什么来解决这个问题?

I'm trying to install pyobjc (using pyobjc-1.2-python2.3-macosx10.2.dmg) on a Mac running OSX 10.6 and I get the following error message:

alt text

To use Python 2.3 I tried re-editing my .bash_profile and I commented out everything with the exception of this line:

# change python version 
defaults write com.apple.versioner.python Version 2.3

I did previously include this:

PATH="/Library/Frameworks/Python.framework/Versions/2.3/bin:/usr/bin:/bin${PATH}"
export PATH

but at the moment left it out. I know that when I type python in the terminal it gives me Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29) so it clearly is not using 2.3.

What can I do to fix this?

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

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

发布评论

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

评论(1

后来的我们 2024-10-15 20:45:55

该版本的 PyObjC 非常旧。它甚至可能无法在 Mac OS X 10.6 上运行。此外,Apple 并未随 OS X 10.6 提供完整的 python2.3。 Apple 提供的 Python 2.6 (/usr/bin/python2.6) 已安装 PyObjC。如果您需要更新的版本,请安装最新的 Python 2.6 (或 < a href="http://www.python.org/download/releases/2.7.1/" rel="nofollow">Python 2.7),使用来自 python.org< 的 OS X 安装程序/code> 网站,使用 Distribute 安装该 Python 的 easy_installsetuptools,然后安装 PyPi 中的 PyObjC

/Library/Frameworks/Python.framework/Versions/2.6/bin/easy_install pyobjc

您也应该撤消该 defaults 命令的效果。这只会引起问题。

defaults write com.apple.versioner.python Version 2.6

That version of PyObjC is very old. It may not even run on Mac OS X 10.6. Further, Apple doesn't ship a full python2.3 with OS X 10.6. The Apple-supplied Python 2.6 (/usr/bin/python2.6) already has PyObjC installed. If you need an even newer version, installer the latest Python 2.6 (or Python 2.7) using a OS X installer from the python.org website, install easy_install for that Python using Distribute or setuptools, and then install PyObjC from PyPi:

/Library/Frameworks/Python.framework/Versions/2.6/bin/easy_install pyobjc

You should undo the effects of that defaults command, too. It is only going to cause problems.

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