Mac Python“安装步骤失败:运行飞行后脚本”

2024-05-19 06:46:26 发布

您现在位置:Python中文网/ 问答频道 /正文

我是Python开发新手,在尝试安装aptanastudio时,我似乎把Python的安装搞砸了。所以我按照这里的卸载MacPython的说明http://homepages.cwi.nl/~jack/macpython/uninstall.html

…现在我正试图再次安装Python。在

据我所知,GAE需要你有python2.5。因此,我尝试从这里安装2.5.4版本:http://www.python.org/download/releases/2.5.4/我已经下载了dmg,安装时出现以下错误:

The installation failed.

The following installation step failed: run postflight script for Fix system Python. Contact the software manufacturer for assistance

安装程序在安装python.2.2时遇到了同样的错误。在

我运行的是OS 10.6.8

有什么想法吗?在Mac上安装Python有更好的/不同的方法吗?在

更新: 当我打开我的安装程序日志时,我看到了一些问题: 我有很多这样的错误:

^{pr2}$

最后我得到了这个:

Sep 19 14:04:40 thething Installer[1641]: run postflight script for Fix system Python
Sep 19 14:04:40 thething runner[1657]: postflight[1722]: Could not find platform independent libraries <prefix>
Sep 19 14:04:40 thething runner[1657]: postflight[1722]: Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Sep 19 14:04:40 thething runner[1657]: postflight[1722]: 
Sep 19 14:04:40 thething runner[1657]: postflight[1722]: 'import site' failed; use -v for traceback
Sep 19 14:04:40 thething runner[1657]: postflight[1722]: Traceback (most recent call last):
Sep 19 14:04:40 thething runner[1657]: postflight[1722]:   File "/Volumes/Python 2.6.6/Python.mpkg/Contents/Packages/PythonSystemFixes-2.6.pkg/Contents/Resources/postflight", line 16, in <module>
Sep 19 14:04:40 thething runner[1657]: postflight[1722]:     import os
Sep 19 14:04:40 thething runner[1657]: postflight[1722]: ImportError: No module named os
Sep 19 14:04:40 thething runner[1657]: postflight[1722]: 
Sep 19 14:04:40 thething Installer[1641]: Install failed: The following installation step failed: run postflight script for Fix system Python. Contact the software manufacturer for assistance.
Sep 19 14:04:40 thething Installer[1641]: IFDInstallController 207240 state = 7
Sep 19 14:04:40 thething Installer[1641]: Displaying 'Install Failed' UI.
Sep 19 14:04:40 thething Installer[1641]: 'Install Failed' UI displayed message:'The following installation step failed: run postflight script for Fix system Python. Contact the software manufacturer for assistance.'.

Tags: therunfor错误installerscriptinstallationfix
2条回答

只要不使用post2.5语言结构或包,就可以使用更新的Python进行开发。(我使用的是2.6.5。)

Python2.7on the way的官方支持。在

好的,根据你关于/usr/bin/python失败的信息(我担心可能是这样!),苹果提供的系统Python似乎有问题。也许您错误地删除了/System/Library/Frameworks/Python.frameworks中的内容,这是苹果提供的Python所在的地方,应该永远不要修改或删除而不是/Library/Frameworks/Python.frameworks。或者,您之前遵循了pythonwiki here上不幸的误导性建议,创建了一个从/Library/Frameworks/Python.frameworks到系统Python框架的符号链接,这可能导致在安装新版本的Python时无意中损坏系统Python。安装程序日志中的BOMFatalError消息是正常的,可以忽略。同样,安装程序的Fix system Python包失败本身也不是问题,因为它只适用于OSX10.3。然而,它之所以失败是因为系统Python正在失败,这是一个问题。在

如果您有系统文件的Time Machine备份或其他备份,您可能能够正确地(并且小心地!)从备份还原/System/Library/Python.frameworks/。从雪豹OSX安装程序DVD中提取必要的文件是困难的,但并非不可能。如果您有一台运行同一版本OS X的类似机器,您可能可以从那里复制文件。或者在未使用的磁盘分区上安装10.6。一个简单但不完善的解决方法是只创建一个从/usr/bin/python和朋友到python.org网站只需等到重新安装Snow Leopard或升级到Lion(在升级之前删除该符号链接可能是最安全的)。所以像这样:

sudo bash
cd /usr/bin
mv python python-DISABLED
ln -s /usr/local/bin/python python
exit

相关问题 更多 >

    热门问题