9

Buildout doesn't like my system-wide Distribute installation and refuses to run:

plone@s15447224:~/mybuildout$ python bootstrap.py 
Creating directory '/home/plone/mybuildout/bin'.
Creating directory '/home/plone/mybuildout/parts'.
Creating directory '/home/plone/mybuildout/eggs'.
Creating directory '/home/plone/mybuildout/develop-eggs'.
Getting distribution for 'distribute==0.6.14'.
Before install bootstrap.
Scanning installed packages
Setuptools installation detected at /usr/lib/python2.6/dist-packages
Non-egg installation
Removing elements out of the way...
Already patched.
/usr/lib/python2.6/dist-packages/setuptools.egg-info already patched.
After install bootstrap.
Creating /usr/local/lib/python2.6/dist-packages/setuptools-0.6c11-py2.6.egg-info
error: /usr/local/lib/python2.6/dist-packages/setuptools-0.6c11-py2.6.egg-info: Permission denied
An error occurred when trying to install distribute 0.6.14. Look above this message for any errors that were output by easy_install.
While:
  Bootstrapping.
  Getting distribution for 'distribute==0.6.14'.
Error: Couldn't install: distribute 0.6.14

Is there some way to tell buildout to install its own Distribute and not to mess with system-wide Python installation?

I know about virtualenv. But it seems to be an overkill just to install virtualenv to make buildout happy. There must be some other way.

Python 2.6. Plone 4.1. Ubuntu 10.4.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Mikko Ohtamaa
  • 82,057
  • 50
  • 264
  • 435

5 Answers5

4

Yes, use Buildout 1.5.x which runs Python with the '-S' argument (-S : don't imply 'import site' on initialization).

(and you might try upgrading your system-wide Distribute to the latest version too)

aclark
  • 4,345
  • 1
  • 19
  • 31
3

I have seen this too. I think I always ended up 'solving' it by indeed using a virtualenv or by accepting the fact that the global setuptools should be updated and doing that manually with something like sudo easy_install -U setuptools (or maybe use distribute as package name).

It might be that this problem is just caused by some versions of bootstrap.py. But that is just a theory. I add this one to most of my Plone 3 buildouts: http://svn.zope.org/*checkout*/zc.buildout/tags/1.4.4/bootstrap/bootstrap.py

myroslav
  • 3,703
  • 23
  • 29
maurits
  • 2,355
  • 13
  • 16
3

Seems to be a bug in distribute_setup.py, currently the workaround is to use setuptools bootstrap.py

EDIT: further details in https://bitbucket.org/tarek/distribute/issue/231/bootstrappy-tries-to-modify-global-python#comment-1254375 EDIT2: fixed http://pypi.python.org/pypi/distribute/0.6.27#id2

iElectric
  • 5,633
  • 1
  • 29
  • 31
0

I use the same concept as @maurits . Here is Makefile snippet that:

  1. creates virtualenv
  2. installs buildout inside virtualenv
  3. and runs builtout -c builtout.cfg

Makefile:

PROJECT_NAME = <virtualenv_name>
PYTHON := $(shell if [ ! -z "`python --version 2>&1 | grep 'Python 2'`" ] ; then echo python; else echo python2; fi)

virtual:
    virtualenv --unzip-setuptools --prompt='$(PROJECT_NAME)::' --python=$(PYTHON) virtual \
    || \
    virtualenv --unzip-setuptools --python=$(PYTHON) virtual

development: virtual
    . virtual/bin/activate && make -C . construct-env

construct-env:
    pip install zc.buildout
    buildout -c buildout.cfg
aisbaa
  • 9,867
  • 6
  • 33
  • 48
0

kgs provided by zope pin the version of setuptools and distribute: http://download.zope.org/zopetoolkit/index/1.0.2/ztk-versions.cfg

setuptools = 0.6c11 distribute = 0.6.14

The best is to remove python-setuptools package from your system. bootstrap is here to be sure you have setuptools or distribute (-d option) but your buildout is asking these versions.

Quite weird.

toutpt
  • 5,145
  • 5
  • 38
  • 45