如何在 OSX 上恢复默认的 python 安装?
我尝试在运行 OSX 10.6 的 Mac 上安装 pyobjc (使用 pyobjc-1.2-python2.3-macosx10.2.dmg),但收到以下错误消息:
要使用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:
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该版本的
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_install
或setuptools,然后安装 PyPi 中的 PyObjC:您也应该撤消该
defaults
命令的效果。这只会引起问题。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 hasPyObjC
installed. If you need an even newer version, installer the latest Python 2.6 (or Python 2.7) using a OS X installer from thepython.org
website, installeasy_install
for that Python using Distribute or setuptools, and then install PyObjC from PyPi:You should undo the effects of that
defaults
command, too. It is only going to cause problems.