I have copied my home folder from a Mac OSX 10.5 to a new Mac OSX 10.6. This broke east_intall for binary packages. For example if I use Python 2.5:
> easy_install celery
Searching for celery
Reading http://pypi.py开发者_JAVA技巧thon.org/simple/celery/
Reading http://github.com/ask/celery/
Reading http://celeryproject.org
Best match: celery 2.2.7
Downloading http://pypi.python.org/packages/source/c/celery/celery-2.2.7.tar.gz#md5=5826cf891eaa6175cc7aab67818094fe
Processing celery-2.2.7.tar.gz
Running celery-2.2.7/setup.py -q bdist_egg --dist-dir /var/folders/TK/TKwwrl0JEyKrCVteN9D+Jk+++TI/-Tmp-/easy_install-RSjVZt/celery-2.2.7/egg-dist-tmp-w4bMT_
...
In file included from Modules/_multiprocessing/multiprocessing.h:6,
from Modules/_multiprocessing/multiprocessing.c:9:
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:18:20: error: limits.h: No such file or directory
...
... millions of errors
...
error: Setup script exited with error: command 'gcc' failed with exit status 1
If I use Python 2.6
> easy_install-2.6 celery
Searching for celery
Reading http://pypi.python.org/simple/celery/
Reading http://github.com/ask/celery/
Reading http://celeryproject.org
Best match: celery 2.2.7
Downloading http://pypi.python.org/packages/source/c/celery/celery-2.2.7.tar.gz#md5=5826cf891eaa6175cc7aab67818094fe
Processing celery-2.2.7.tar.gz
Running celery-2.2.7/setup.py -q bdist_egg --dist-dir /var/folders/TK/TKwwrl0JEyKrCVteN9D+Jk+++TI/-Tmp-/easy_install-dCVly4/celery-2.2.7/egg-dist-tmp-PqOUyI
error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: /var/folders/TK/TKwwrl0JEyKrCVteN9D+Jk+++TI/-Tmp-/easy_install-dCVly4/celery-2.2.7/temp/easy_install-61UKvH/PasteDeploy-1.5.0/temp/easy_install-ExR4d0/Paste-1.7.5.1/temp/easy_install-OJw80Y/PasteDeploy-1.5.0/temp/easy_install-Zg0wGJ/Paste-1.7.5.1/temp/easy_install-aWn8hm/PasteDeploy-1.5.0/temp/easy_install-1TOXq2/Paste-1.7.5.1/temp/easy_install-r97tJG/PasteDeploy-1.5.0/temp/easy_install-CNdClq/Paste-1.7.5.1/temp/easy_install-XUejp4/PasteDeploy-1.5.0/temp/easy_install-xN6Jd6/Paste-1.7.5.1/temp/easy_install-zFbJOI/PasteDeploy-1.5.0/temp/easy_install-fc2q_2/Paste-1.7.5.1/temp/easy_install-1rTVrG/PasteDeploy-1.5.0/temp/easy_install-rii66v/Paste-1.7.5.1/temp/easy_install-cZBf5J/PasteDeploy-1.5.0/temp/easy_install-ICPv8M/Paste-1.7.5.1/temp/easy_install-RwRQIz/PasteDeploy-1.5.0/temp/easy_install-x74lHT/Paste-1.7.5.1/temp/easy_install-Yf8l74/PasteDeploy-1.5.0/temp/easy_install-fnl5Wt/Paste-1.7.5.1/temp/easy_install-OwWNt9/PasteDeploy-1.5.0/temp/easy_install-WkOs3d/Paste-1.7.5.1/docs/include/reference_header.txt: File name too long
This is not a celery specific question. I get similar errors with lxml, matplotlib, scipy, etc. The problem occurs with all binary packages, not pure python packages. What am I doing wrong?
> which easy_install
/Library/Frameworks/Python.framework/Versions/Current/bin/easy_install
> which easy_install-2.6
/usr/bin/easy_install-2.6
It is difficult to tell for sure with the abbreviated tracebacks you included. One possibility is that the separate Python 2.5 you had installed on Mac OS X 10.5, most likely using a python.org installer, did not get copied over. If so, you either need to install a similar Python 2.5 there or move /Library/Frameworks/Python.frameworks
from the old installation. Or you should update to using a newer Python, either a system one or one from python.org or one of the third-party open source distributors for Mac OS X, like MacPorts or homebrew or Fink or ActiveState.
Another possibility is that you need to install the optional MacOSX 10.4u SDK
from the Xcode 3 installer for Mac OS X 10.6. If that is the case, you should be seeing error messages that include either 10.3
or 10.4
in them.
Update: So it seems you do have an easy_install
installed for the extra python.org or at least for whatever version of Python is pointed to by /Library/Frameworks/Python.framework/Versions/Current
. You seem to have to have two separate problems here (with the Python 2.5 and another with the system Python 2.6). At this point, it is difficult for me to guess what either of the problems is without getting a lot more information. It is probably best to clean up and start over.
If you want to remove the old Python 2.5 carried over from your old system, you can follow the instructions here on how to remove a python.org installed Python. If you want to, you can make a copy of it first or rename it instead with something like:
cd /Library/Frameworks/Python.framework/Versions sudo mv 2.5 2.5-OLD
Consider doing the same for any other Python version there. DO NOT delete or modify any files in
/System/Library/Frameworks
or/usr/bin
. Those directories are part of OS X.Make sure you clean up your shell profile files,
.bash_profile
etc, to ensure that your PATH no longer includes this Python. Make you don't have any unexpectedPYTHONPATH
environment variables defined.Make sure you don't have any outdated Distutils configurations files in your home directory. Look for and rename or remove things like
.pydistutils.cfg
.cd ~ ls -al
Also make sure you don't have any unexpected private packages installed in local directories.
ls -al ~/Library/Python ls -al ~/.local
Inspect and, if necessary, delete anything in the
site-packages
directories for the Apple-supplied Pythons:cd /Library/Python/2.6/site-packages ls -al cd /Library/Python/2.5/site-packages ls -al
Start a new terminal session and verify that all is well.
Decide what versions of Python you want to use with 10.6. If you are OK with using the Apple-suppled 2.6.1 or 2.5.4 versions, then use them. They both come with their own versions of
easy_install
in/usr/bin
.$ ls -l /usr/bin/python* -rwxr-xr-x 2 root wheel 86000 Jun 24 2010 /usr/bin/python* -rwxr-xr-x 5 root wheel 925 Jul 7 2009 /usr/bin/python-config* lrwxr-xr-x 1 root wheel 75 Nov 7 2010 /usr/bin/python2.5@ -> ../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5 lrwxr-xr-x 1 root wheel 82 Nov 7 2010 /usr/bin/python2.5-config@ -> ../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5-config lrwxr-xr-x 1 root wheel 75 Nov 7 2010 /usr/bin/python2.6@ -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6 lrwxr-xr-x 1 root wheel 82 Nov 7 2010 /usr/bin/python2.6-config@ -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6-config -rwxr-xr-x 2 root wheel 86000 Jun 24 2010 /usr/bin/pythonw* lrwxr-xr-x 1 root wheel 76 Nov 7 2010 /usr/bin/pythonw2.5@ -> ../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/pythonw2.5 lrwxr-xr-x 1 root wheel 76 Nov 7 2010 /usr/bin/pythonw2.6@ -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/pythonw2.6 $ ls -l /usr/bin/easy* -rwxr-xr-x 2 root wheel 925 Jun 30 2009 /usr/bin/easy_install* -rwxr-xr-x 1 root wheel 421 Jun 30 2009 /usr/bin/easy_install-2.5* -rwxr-xr-x 1 root wheel 421 Jun 30 2009 /usr/bin/easy_install-2.6*
If you want more recent and up-to-date versions of Python, consider installing the latest Pythons (Python 2.7.2 is the current version of Python 2) from python.org or homebrew, MacPorts, Fink, ActiveState etc. Update your shell PATH as necessary. (For example, the python.org installers by default modify your shell profiles appropriately.)
If the installation doesn't already come with an
easy_install
(python.org doesn't, some of the others have an optional package to do so), install the Distribute package which will provide aneasy_install
for it.
Have you installed XCode? It looks like you haven't.
精彩评论