0

I'm running Mac OSX 10.7.5 with Pythons 2.5-2.7 installed. One of the dependencies of my app is newrelic 1.9.0.13 (which is located here). When I bootstrap and build for Python 2.6 or 2.7, everything works flawlessly; but not when I specify 2.5:

[buildout]
...
python = python

[python]
executable = /usr/bin/python2.5

With this configuration, running buildout fails with the following error:

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 the tarball directly produces the same message, however the install succeeds. This is not specific to the newrelic package; if I remove that dependency, the same thing happens for PIL (again, only when using Python 2.5).

If I use distribute instead, I get a different error when running 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'

(I'm not sure whether this is related; I include it in case it may be.)

Why is the package failing to install and how can I fix it?

A couple notes:

  • The error occurs whether I include the package using a recipe (zc.recipe.egg) or list it in the install_requires list of my setup.py
  • The package is successfully downloaded; the error happens during installation.
  • The same config works without changes in Python 2.6 and 2.7

Thanks!

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
matthewwithanm
  • 3,733
  • 2
  • 21
  • 27

2 Answers2

2

The new Bootsrtrap.py is released, and the old fails to work.

try python bootstrap.py -v 1.7.0 to make run the old properly or use new one

Cyril
  • 21
  • 2
1

@Cyril, your solution worked great for me! Thanks.

I've had this problem before, and been able to fix it by swapping in for a newer bootstrap.py file, but as some of my builds started mysteriously failing over the weekend, on this occasion I bothered to look at the bootstrap.py code.

What I found is that if you don't specify the version (the zc.buildout version) bootstrap.py will download the latest, which mightn't be compatible with your bootstrap.py version (a shame it couldn't be a LOT more informative about this).

python bootstrap.py --version 1.7 # compatible zc.buildout version number

I daresay a few people will be getting this error of late because Version 2.0 of zc.buildout was just released. There are a few places you can download bootstrap.py but http://downloads.buildout.org/ is the official source. Moral is, keep it up-to-date if you can.

steevee
  • 2,238
  • 1
  • 21
  • 16