easy_install 在 Mac 上损坏

发布于 2024-11-27 19:23:40 字数 3559 浏览 1 评论 0原文

我已将主文件夹从 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

这不是一个 celery 特定的问题。我在 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

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

> 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

删除→记忆 2024-12-04 19:23:40

通过您所包含的简短回溯很难确定。一种可能性是您在 Mac OS X 10.5 上安装的单独的 Python 2.5(很可能使用 python.org 安装程序)没有被复制。如果是这样,您需要在那里安装类似的 Python 2.5,或者从旧安装中移动 /Library/Frameworks/Python.frameworks。或者您应该更新为使用较新的 Python,可以是 python.org 的系统之一,也可以是 Mac OS X 的第三方开源发行商之一,例如 MacPorts、homebrew、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/ 指向的任何版本的 Python 安装了一个 easy_install当前。您似乎必须在这里遇到两个单独的问题(一个是Python 2.5,另一个是系统Python 2.6)。此时,如果没有获得更多信息,我很难猜测其中任何一个问题是什么。最好的办法可能是清理并重新开始。

  1. 如果您想删除旧系统中遗留的旧 Python 2.5,您可以按照此处的说明进行操作 关于如何删除 python.org 上安装的 Python。如果您愿意,可以先复制它或将其重命名为:

    cd /Library/Frameworks/Python.framework/Versions
    sudo mv 2.5 2.5-旧 
    

    考虑对任何其他 Python 版本执行相同的操作。请勿删除或修改 /System/Library/Frameworks/usr/bin 中的任何文件。这些目录是 OS X 的一部分。

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

  3. 确保您的主目录中没有任何过时的 Distutils 配置文件。查找并重命名或删除诸如 .pydistutils.cfg 之类的内容。

    <前><代码>cd ~
    ls-al

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

    ls -al ~/Library/Python
    ls -al ~/.local
    
  4. 检查并在必要时删除 Apple 提供的 Python 的 site-packages 目录中的所有内容:

    cd /Library/Python/2.6/site-packages
    ls-al
    cd /Library/Python/2.5/site-packages
    ls-al
    
  5. 启动一个新的终端会话并验证一切是否正常.

  6. 决定您想要在 10.6 中使用哪些版本的 Python。如果您可以使用 Apple 提供的 2.6.1 或 2.5.4 版本,请使用它们。它们都在 /usr/bin 中附带了自己的 easy_install 版本。

    <前><代码>$ ls -l /usr/bin/python*
    -rwxr-xr-x 2 根轮 86000 2010 年 6 月 24 日 /usr/bin/python*
    -rwxr-xr-x 5 根轮 925 2009 年 7 月 7 日 /usr/bin/python-config*
    lrwxr-xr-x 1根轮 75 Nov 7 2010 /usr/bin/python2.5@ -> ../../系统/库/框架/Python.framework/版本/2.5/bin/python2.5
    lrwxr-xr-x 1根轮 82 Nov 7 2010 /usr/bin/python2.5-config@ -> ../../系统/库/框架/Python.framework/Versions/2.5/bin/python2.5-config
    lrwxr-xr-x 1根轮 75 Nov 7 2010 /usr/bin/python2.6@ -> ../../系统/库/框架/Python.framework/版本/2.6/bin/python2.6
    lrwxr-xr-x 1根轮 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 根轮 86000 2010 年 6 月 24 日 /usr/bin/pythonw*
    lrwxr-xr-x 1根轮 76 Nov 7 2010 /usr/bin/pythonw2.5@ -> ../../系统/库/框架/Python.framework/版本/2.5/bin/pythonw2.5
    lrwxr-xr-x 1根轮 76 Nov 7 2010 /usr/bin/pythonw2.6@ -> ../../系统/库/框架/Python.framework/版本/2.6/bin/pythonw2.6
    $ ls -l /usr/bin/easy*
    -rwxr-xr-x 2 根轮 925 2009 年 6 月 30 日 /usr/bin/easy_install*
    -rwxr-xr-x 1 根轮 421 2009 年 6 月 30 日 /usr/bin/easy_install-2.5*
    -rwxr-xr-x 1 根轮 421 2009 年 6 月 30 日 /usr/bin/easy_install-2.6*

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

  8. 如果安装尚未附带 easy_install(python.org 没有,则某些其他人有一个可选的包来执行此操作),安装 Distribute 包,它将提供一个 easy_install

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.

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

  2. 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 unexpected PYTHONPATH environment variables defined.

  3. 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
    
  4. 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
    
  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. 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*
    
  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. (For example, the python.org installers by default modify your shell profiles appropriately.)

  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.

自演自醉 2024-12-04 19:23:40

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

Have you installed XCode? It looks like you haven't.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文