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

Mac Python“;安装步骤失败:运行飞行后脚本;,python,google-app-engine,installation,Python,Google App Engine,Installation,我是Python开发新手,在尝试安装Aptana Studio时,我似乎把Python安装搞砸了。因此,我按照这里的卸载MacPython说明进行了操作 …现在我正在尝试再次安装Python 据我所知,GAE需要您拥有Python 2.5。因此,我尝试从这里安装2.5.4版本:我已下载dmg,安装时出现以下错误: The installation failed. The following installation step failed: run postflight script for

我是Python开发新手,在尝试安装Aptana Studio时,我似乎把Python安装搞砸了。因此,我按照这里的卸载MacPython说明进行了操作

…现在我正在尝试再次安装Python

据我所知,GAE需要您拥有Python 2.5。因此,我尝试从这里安装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.5、2.6和2.7 dmg安装程序,在安装所有3个dmg安装程序时,我都遇到了相同的错误

我正在运行OS 10.6.8

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

更新: 当我打开安装程序日志时,我看到以下几个问题: 我犯了很多这样的错误:

Sep 19 14:04:39 thething pkgExtractor[1689]: BomFatalError - cpio read error: bad file format
Sep 19 14:04:39 thething pkgExtractor[1689]: Package Authoring Error: Package "PythonSystemFixes-2.6.pkg" is using a deprecated archive format. Running in compatibility mode.
最后我得到了这个:

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.'.
Sep 19 14:04:40 Thing Installer[1641]:为修复系统Python运行飞行后脚本
Sep 19 14:04:40 thething runner[1657]:飞行后[1722]:找不到与平台无关的库
9月19日14:04:40《奔跑者》(1657):飞行后[ 1722 ]:考虑设置$PythONHOLD到[:]
9月19日14:04:40第三名跑步者[1657]:飞行后[1722]:
9月19日14:04:40 Thing runner[1657]:飞行后[1722]:“导入站点”失败;使用-v进行回溯
9月19日14:04:40 thething runner[1657]:飞行后[1722]:回溯(最近一次呼叫最后一次):
9月19日14:04:40 Thing runner[1657]:飞行后[1722]:文件“/Volumes/Python 2.6.6/Python.mpkg/Contents/Packages/PythonSystemFixes-2.6.pkg/Contents/Resources/postflight”,第16行,in
9月19日14:04:40 Thing runner[1657]:飞行后[1722]:导入操作系统
Sep 19 14:04:40 thething runner[1657]:飞行后[1722]:导入错误:没有名为os的模块
9月19日14:04:40第三名跑步者[1657]:飞行后[1722]:
Sep 19 14:04:40 Thing Installer[1641]:安装失败:以下安装步骤失败:运行修复系统Python的postflight脚本。请联系软件制造商以获得帮助。
9月19日14:04:40安装程序[1641]:IFDInstallController 207240 state=7
Sep 19 14:04:40 Thing Installer[1641]:显示“安装失败”用户界面。
9月19日14:04:40安装程序[1641]:“安装失败”UI显示消息:“以下安装步骤失败:运行修复系统Python的postflight脚本。请与软件制造商联系以获得帮助。“。

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


Python 2.7的官方支持。

好的,根据您关于
/usr/bin/Python
失败的信息(我担心可能是这样!),您的Apple提供的Python系统似乎存在问题。也许您错误地删除了
/System/Library/Frameworks/Python.Frameworks
中的某些内容,这是苹果提供的Python所在的位置,永远不应该修改或删除,而应该是
/Library/Frameworks/Python.Frameworks
。或者,您之前在PythonWiki上遵循了不幸的错误建议,创建了从
/Library/Frameworks/Python.Frameworks
到系统Python框架的符号链接,这可能会在安装新版本的Python时导致系统Python的意外损坏。安装程序日志中的
bomfataleror
消息是正常的,可以忽略。同样,安装程序的
修复系统Python
包失败本身也不是问题,因为它只适用于OS X 10.3。但是,它失败了,因为系统Python失败了,这是一个问题

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

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

您使用的是什么版本的OS X?请再次尝试运行安装程序,并检查安装程序日志中的完整错误消息:installer->Window->installer log然后在出现的日志窗口中,在左上角的下拉菜单中选择Show All Logs(显示所有日志)。如果问题不明显,粘贴日志的相关部分。如果在终端窗口中键入<代码> /Ur/bin/Python < /代码>会发生什么?/UR/BIN/Python找不到与平台无关的库,考虑将$python HOLD设置为[:]导入站点“失败”;使用-v来回溯Python 2.6.1(r261:67515,2010年6月24日,21:47:49)[GCC 4.2.1(Apple Inc.build 5646)],在darwin上键入“帮助”、“版权”、“信用”或“许可证”以获取更多信息。>>奈德,我真的很感谢你的帮助!我想我们越来越近了。我将安装程序日志中的信息放入我的问题中。终端窗口中/usr/bin/python的结果在这条评论上面。感谢Dave提供的信息!我尝试从Mac安装程序磁盘映像安装2.6.6,但我得到了完全相同的“运行postflight”错误。我确实根据某个愚蠢的帖子删除了Python.frameworks。我在另一篇帖子上看到,我不应该弄乱它(在我破坏了它之后),我试图复制文件,但它不起作用。因此,我必须对以前的备份进行完整的系统恢复。谢天谢地,时间机器:)我无法告诉你我有多感激你的帮助。