简体   繁体   English

在Mac上的easy_install损坏

[英]easy_install broken on Mac

I have copied my home folder from a Mac OSX 10.5 to a new Mac OSX 10.6. 我已将主文件夹从Mac OSX 10.5复制到新的Mac OSX 10.6。 This broke east_intall for binary packages. 对于二进制软件包,这破坏了east_intall。 For example if I use Python 2.5: 例如,如果我使用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

If I use Python 2.6 如果我使用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. 我在使用lxml,matplotlib,scipy等时遇到类似的错误。所有二进制程序包(而非纯python程序包)都会出现此问题。 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. 一种可能是您复制在Mac OS X 10.5上安装的单独的Python 2.5(很可能是使用python.org安装程序)而无法复制的。 If so, you either need to install a similar Python 2.5 there or move /Library/Frameworks/Python.frameworks from the old installation. 如果是这样,您要么需要在其中安装类似的Python 2.5,要么将/Library/Frameworks/Python.frameworks从旧的安装中移出。 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. 或者,您应该更新为使用更新的Python,即来自python.org的一个或一个系统,或Mac OS X的第三方开源发行商之一,例如MacPorts或自制软件,Fink或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. 另一种可能性是您需要从Mac OS X 10.6的Xcode 3安装程序安装可选的MacOSX 10.4u SDK If that is the case, you should be seeing error messages that include either 10.3 or 10.4 in them. 如果是这种情况,您应该看到其中包含10.310.4错误消息。

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 . 更新:看来您确实为多余的python.org或至少/Library/Frameworks/Python.framework/Versions/Current指向的任何Python版本都安装了easy_install You seem to have to have two separate problems here (with the Python 2.5 and another with the system Python 2.6). 您似乎在这里有两个单独的问题(Python 2.5和系统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. 最好清理并重新开始。

  1. 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. 如果您要从旧系统中删除旧的Python 2.5,可以按照此处的说明操作,以删除已安装的python.org 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. 考虑在那里对任何其他Python版本执行相同的操作。 DO NOT delete or modify any files in /System/Library/Frameworks or /usr/bin . 不要删除或修改/System/Library/Frameworks/usr/bin任何文件。 Those directories are part of OS X. 这些目录是OS X的一部分。

  2. Make sure you clean up your shell profile files, .bash_profile etc, to ensure that your PATH no longer includes this Python. 确保清理外壳配置文件, .bash_profile等,以确保PATH不再包含此Python。 Make you don't have any unexpected PYTHONPATH environment variables defined. 使您没有定义任何意外的PYTHONPATH环境变量。

  3. Make sure you don't have any outdated Distutils configurations files in your home directory. 确保主目录中没有任何过时的Distutils配置文件。 Look for and rename or remove things like .pydistutils.cfg . 查找并重命名或删除.pydistutils.cfg类的.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 
  4. Inspect and, if necessary, delete anything in the site-packages directories for the Apple-supplied Pythons: 检查并在必要时删除Apple提供的Python的site-packages目录中的所有内容:

     cd /Library/Python/2.6/site-packages ls -al cd /Library/Python/2.5/site-packages ls -al 
  5. Start a new terminal session and verify that all is well. 启动一个新的终端会话,并确认一切正常。

  6. Decide what versions of Python you want to use with 10.6. 确定要与10.6一起使用的Python版本。 If you are OK with using the Apple-suppled 2.6.1 or 2.5.4 versions, then use them. 如果可以使用Apple提供的2.6.1或2.5.4版本,请使用它们。 They both come with their own versions of easy_install in /usr/bin . 它们都在/usr/bin带有自己的easy_install版本。

     $ 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* 
  7. 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. 如果您需要更新的Python版本,请考虑从python.org或自制软件,MacPorts,Fink,ActiveState等安装最新的Python(Python 2.7.2是Python 2的当前版本)。更新您的shell必要时使用PATH。 (For example, the python.org installers by default modify your shell profiles appropriately.) (例如,默认情况下python.org安装程序会适当修改您的Shell配置文件。)

  8. 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 an easy_install for it. 如果安装尚未随easy_install (python.org尚未提供,则其他一些工具具有可选软件包),请安装Distribute软件包,该软件包将为其提供easy_install

Have you installed XCode? 你安装了XCode吗? It looks like you haven't. 看来您还没有。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM