Python 2.5-2.7 がインストールされた Mac OSX 10.7.5 を実行しています。私のアプリの依存関係の 1 つは 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
tarball を直接 easy_installing すると同じメッセージが表示されますが、インストールは成功します。これは 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'
(関連性があるかどうかはわかりませんが、可能性がある場合に備えて含めます。)
パッケージのインストールに失敗するのはなぜですか? どうすれば修正できますか?
いくつかのメモ:
install_requires
レシピ (zc.recipe.egg) を使用してパッケージを含めるか、setup.pyのリストにリストするかに関係なく、エラーが発生します。- パッケージが正常にダウンロードされました。インストール中にエラーが発生します。
- Python 2.6 および 2.7 では、同じ構成が変更なしで機能します。
ありがとう!