easy_install 在 Mac 上损坏
我已将主文件夹从 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(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、homebrew、Fink 或 ActiveState。另一种可能性是,您需要从适用于 Mac OS X 10.6 的 Xcode 3 安装程序安装可选的
MacOSX 10.4u SDK
。如果是这种情况,您应该会看到包含10.3
或10.4
的错误消息。更新:所以看来你确实为额外的 python.org 安装了一个
easy_install
,或者至少为/Library/Frameworks/Python.framework/Versions/ 指向的任何版本的 Python 安装了一个
。您似乎必须在这里遇到两个单独的问题(一个是Python 2.5,另一个是系统Python 2.6)。此时,如果没有获得更多信息,我很难猜测其中任何一个问题是什么。最好的办法可能是清理并重新开始。easy_install
当前如果您想删除旧系统中遗留的旧 Python 2.5,您可以按照此处的说明进行操作 关于如何删除 python.org 上安装的 Python。如果您愿意,可以先复制它或将其重命名为:
考虑对任何其他 Python 版本执行相同的操作。请勿删除或修改
/System/Library/Frameworks
或/usr/bin
中的任何文件。这些目录是 OS X 的一部分。确保清理 shell 配置文件、
.bash_profile
等,以确保您的 PATH 不再包含此 Python。确保您没有定义任何意外的PYTHONPATH
环境变量。确保您的主目录中没有任何过时的 Distutils 配置文件。查找并重命名或删除诸如
.pydistutils.cfg
之类的内容。<前><代码>cd ~
ls-al
还要确保本地目录中没有安装任何意外的私有软件包。
检查并在必要时删除 Apple 提供的 Python 的
site-packages
目录中的所有内容:启动一个新的终端会话并验证一切是否正常.
决定您想要在 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*
如果您想要更新版本的 Python,请考虑从 python.org 或 homebrew、MacPorts、Fink、ActiveState 等安装最新的 Python(Python 2.7.2 是 Python 2 的当前版本)。根据需要更新您的 shell 路径。 (例如,默认情况下,python.org 安装程序会相应地修改您的 shell 配置文件。)
如果安装尚未附带
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 either10.3
or10.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:
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
.Also make sure you don't have any unexpected private packages installed in local directories.
Inspect and, if necessary, delete anything in the
site-packages
directories for the Apple-supplied Pythons: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
.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.你安装XCode了吗?看来你还没有。
Have you installed XCode? It looks like you haven't.