我正在运行安装了 Python 2.5-2.7 的 Mac OSX 10.7.5。我的应用程序的依赖项之一是 newrelic 1.9.0.13(位于此处)。当我为 Python 2.6 或 2.7 引导和构建时,一切都完美无缺;但不是当我指定 2.5 时:
[buildout]
...
python = python
[python]
executable = /usr/bin/python2.5
使用此配置,运行 buildout 失败并出现以下错误:
Installing newrelic.
Getting distribution for 'newrelic==1.9.0.13'.
newrelic/lib/simplejson/_speedups.c: In function ‘encoder_listencode_obj’:
newrelic/lib/simplejson/_speedups.c:2263: warning: comparison of distinct pointer types lacks a cast
newrelic/lib/simplejson/_speedups.c:2263: warning: passing argument 2 of ‘PyType_IsSubtype’ from incompatible pointer type
zip_safe flag not set; analyzing archive contents...
newrelic.admin: module references __file__
newrelic.console: module references __file__
newrelic.bootstrap.sitecustomize: module references __file__
newrelic.core.environment: module references __file__
newrelic.core.thread_profiler: module references __file__
newrelic.lib.__init__: module references __path__
While:
Installing newrelic.
Getting distribution for 'newrelic==1.9.0.13'.
Error: Couldn't install: newrelic 1.9.0.13
easy_installing tarball 直接产生相同的消息,但是安装成功。这并不特定于 newrelic 包;如果我删除该依赖项,PIL 也会发生同样的事情(同样,仅在使用 Python 2.5 时)。
如果我改为使用分发,则在运行 buildout 时会出现不同的错误:
Traceback (most recent call last):
File "./bin/buildout", line 17, in <module>
import zc.buildout.buildout
File "/Users/mjt/.buildout/eggs/zc.buildout-1.6.3-py2.7.egg/zc/buildout/buildout.py", line 40, in <module>
import zc.buildout.download
File "/Users/mjt/.buildout/eggs/zc.buildout-1.6.3-py2.7.egg/zc/buildout/download.py", line 20, in <module>
from zc.buildout.easy_install import realpath
File "/Users/mjt/.buildout/eggs/zc.buildout-1.6.3-py2.7.egg/zc/buildout/easy_install.py", line 75, in <module>
pkg_resources.Requirement.parse('setuptools')
AttributeError: 'NoneType' object has no attribute 'location'
(我不确定这是否相关;我将其包括在内以防万一。)
为什么软件包无法安装,我该如何解决?
几点注意事项:
- 无论我使用配方 (zc.recipe.egg) 包含包还是将其
install_requires
列在我的 setup.py 列表中,都会发生错误 - 包下载成功;错误发生在安装过程中。
- 相同的配置在 Python 2.6 和 2.7 中无需更改即可工作
谢谢!