easy_install在Mac上崩溃了

时间:2011-08-03 22:38:22

标签: python easy-install osx-snow-leopard

我已将我的主文件夹从Mac OSX 10.5复制到新的Mac OSX 10.6。这破坏了二进制包的east_intall。例如,如果我使用Python 2.5:

> easy_install 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-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

如果我使用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

这不是芹菜特有的问题。我得到类似的错误与lxml,matplotlib,scipy等。所有二进制包,而不是纯python包出现问题。我做错了什么?

> which easy_install
/Library/Frameworks/Python.framework/Versions/Current/bin/easy_install
> which easy_install-2.6
/usr/bin/easy_install-2.6

2 个答案:

答案 0 :(得分:2)

很难用你所包含的缩写回溯来确定。一种可能性是你在Mac OS X 10.5上安装的单独的Python 2.5,很可能是使用python.org安装程序,没有被复制。如果是这样,您需要在那里安装类似的Python 2.5或从旧安装中移动/Library/Frameworks/Python.frameworks。或者您应该更新为使用较新的Python,可以是python.org中的系统或一个系统,也可以是Mac OS X的第三方开源分发服务器,如MacPorts或自制软件或Fink或ActiveState。

另一种可能性是您需要从适用于Mac OS X 10.6的Xcode 3安装程序安装可选的MacOSX 10.4u SDK。如果是这种情况,您应该会看到包含10.310.4的错误消息。

更新:所以看起来你确实为额外的python.org安装了easy_install,或者至少为/Library/Frameworks/Python.framework/Versions/Current指向的任何版本的Python安装了cd /Library/Frameworks/Python.framework/Versions sudo mv 2.5 2.5-OLD 。你似乎必须在这里有两个独立的问题(使用Python 2.5,另一个使用系统Python 2.6)。在这一点上,我很难在没有获得更多信息的情况下猜出其中任何一个问题。最好是清理并重新开始。

  1. 如果要删除旧系统中遗留的旧Python 2.5,可以按照here说明删除python.org安装的Python。如果您愿意,可以先复制它,或者用以下内容重命名:

    /System/Library/Frameworks

    考虑对那里的任何其他Python版本做同样的事情。请勿删除或修改/usr/bin.bash_profile中的任何文件。这些目录是OS X的一部分。

  2. 确保清理shell配置文件PYTHONPATH等,以确保PATH不再包含此Python。使您没有定义任何意外的.pydistutils.cfg环境变量。

  3. 确保主目录中没有任何过时的Distutils配置文件。查找并重命名或删除cd ~ ls -al 等内容。

    ls -al ~/Library/Python
    ls -al ~/.local
    

    还要确保您没有在本地目录中安装任何意外的私有软件包。

    site-packages
  4. 检查并在必要时删除Apple提供的Pythons的cd /Library/Python/2.6/site-packages ls -al cd /Library/Python/2.5/site-packages ls -al 目录中的任何内容:

    easy_install
  5. 开始新的终端会话并验证一切正常。

  6. 决定要使用10.6的Python版本。如果您可以使用Apple提供的2.6.1或2.5.4版本,那么请使用它们。他们都在/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* 版本。

    easy_install
  7. 如果您想了解更新的Python版本,请考虑从python.org或自制软件安装最新的Pythons(Python 2.7.2是当前版本的Python 2),MacPorts,Fink, ActiveState等根据需要更新shell PATH。 (例如,默认情况下,python.org安装程序会相应地修改您的shell配置文件。)

  8. 如果安装尚未附带easy_install(python.org没有,其他一些人有可选包这样做),请安装Distribute包这将为其提供{{1}}。

答案 1 :(得分:1)

您安装了XCode吗?看起来你没有。