I'm new to Python development, and in trying to get Aptana Studio Setup, I seemed to have messed up my Python install. So I followed the uninstall MacPython instructions here http://homepages.cwi.nl/~jack/macpython/uninstall.html
...and now I'm trying to install Python again.
From what I can tell, GAE needs you to have Python 2.5. So I'm trying to install the 2.5.4 release from here: http://www.python.org/download/releases/2.5.4/ I've downloaded the dmg and when installing I get the following error:
The installation failed.
The following installation step failed: run postflight script for Fix system Python. Contact the software manufacturer for assistance
In fact, I've tried 2.5, 2.6 and 2.7 dmg installers for python, and I got the same exact error when installing all 3.
I'm running OS 10.6.8
Any ideas? Is there a better/different way to install Python on a Mac?
UPDATE: When I open up my installer log, here are a few problems that I see: I got a lot of these type of errors:
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.
And at the end I got this:
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/PythonSyst开发者_JAVA技巧emFixes-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.'.
OK, based on your information about /usr/bin/python
failing (I was afraid that might be the case!), it appears there are problems with your Apple-supplied system Python. Perhaps you mistakenly deleted something in /System/Library/Frameworks/Python.frameworks
, which is where the Apple-supplied Python resides and should never be modified or deleted, instead of /Library/Frameworks/Python.frameworks
. Or perhaps you earlier followed the unfortunately misguided advice on the Python wiki here to create a symlink from /Library/Frameworks/Python.frameworks
to the system Python framework which can result in an inadvertent corruption of the system Python when installing a new version of Python. The BOMFatalError
message in the installer log is normal and can be ignored. Likewise, it is not a problem in itself that the Fix system Python
package of the installer fails since it only applies to OS X 10.3. However, it is failing because the system Python is failing and that is a problem.
If you have a Time Machine
backup or other backup of your System files, you may be able to properly (and carefully!) restore /System/Library/Python.frameworks/
from a backup. It is difficult but not impossible to extract the necessary files from a Snow Leopard OS X Installer DVD. If you have a similar machine running the same version of OS X, you might be able to copy the files from there. Or do a vanilla install of 10.6 to an unused disk partition. A simpler but imperfect workaround is to just create a symlink from /usr/bin/python
and friends to the python.org Python and just wait until you reinstall Snow Leopard or upgrade to Lion (it might be safest to remove that symlink before upgrading). So something like this:
sudo bash
cd /usr/bin
mv python python-DISABLED
ln -s /usr/local/bin/python python
exit
You can develop using more recent Python, as long as you're not using post 2.5 language constructs or packages. (I'm using 2.6.5.)
Official support for Python 2.7 on the way.
精彩评论