Plone 4 buildout, setuptools and zc.buildout

This is driving me nuts, sorry :slightly_smiling:

I try to run my buildout for the latest Plone 4:

cat requirements.txt

setuptools==5.8
zc.buildout==2.2.5

cat buildout.cfg

[buildout]
socket-timeout = 3

extends = http://dist.plone.org/release/4.3-latest/versions.cfg
find-links = http://dist.repoze.org/

show-picked-versions = true

parts =
    instance

[instance]
recipe = plone.recipe.zope2instance
eggs =
    Plone
    Pillow

user = admin:admin
http-address = 8080
shared-blob = on

environment-vars =
    PTS_LANGUAGES=en

Resulting in:

An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
  File "/srv/Projects/test/plone/foo/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1946, in main
    getattr(buildout, command)(args)
  File "/srv/Projects/test/plone/foo/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 510, in install
    [self[part]['recipe'] for part in install_parts]
  File "/srv/Projects/test/plone/foo/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1098, in __getitem__
    options._initialize()
  File "/srv/Projects/test/plone/foo/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1202, in _initialize
    self.initialize()
  File "/srv/Projects/test/plone/foo/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1208, in initialize
    recipe_class = _install_and_load(reqs, 'zc.buildout', entry, buildout)
  File "/srv/Projects/test/plone/foo/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1162, in _install_and_load
    allow_hosts=buildout._allow_hosts
  File "/srv/Projects/test/plone/foo/local/lib/python2.7/site-packages/zc/buildout/easy_install.py", line 844, in install
    return installer.install(specs, working_set)
  File "/srv/Projects/test/plone/foo/local/lib/python2.7/site-packages/zc/buildout/easy_install.py", line 681, in install
    for_buildout_run=for_buildout_run):
  File "/srv/Projects/test/plone/foo/local/lib/python2.7/site-packages/zc/buildout/easy_install.py", line 538, in _get_dist
    ws.add(dist, replace=True)
TypeError: add() got an unexpected keyword argument 'replace'

If I try it without pins for setuptools and zc.buildout I am getting lots of version conflicts for setuptools and zc.buildout

Did someone has any pointers ?

Thanks !

I've been using zc.buildout 2.4.0 and setuptools 18.5. Newer versions of each would probably also work, but I know that I usually don't have problems with these.

Thanks, now I get something else :slightly_smiling:

cat requirements.txt:

setuptools==18.5
zc.buildout==2.4.0

pip install -r requirements.txt
./bin/buildout -vvv

An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
  File "/srv/Projects/test/plone/bar/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1987, in main
    getattr(buildout, command)(args)
  File "/srv/Projects/test/plone/bar/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 552, in install
    [self[part]['recipe'] for part in install_parts]
  File "/srv/Projects/test/plone/bar/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1137, in __getitem__
    options._initialize()
  File "/srv/Projects/test/plone/bar/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1241, in _initialize
    self.initialize()
  File "/srv/Projects/test/plone/bar/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1247, in initialize
    recipe_class = _install_and_load(reqs, 'zc.buildout', entry, buildout)
  File "/srv/Projects/test/plone/bar/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1201, in _install_and_load
    allow_hosts=buildout._allow_hosts
  File "/srv/Projects/test/plone/bar/local/lib/python2.7/site-packages/zc/buildout/easy_install.py", line 848, in install
    return installer.install(specs, working_set)
  File "/srv/Projects/test/plone/bar/local/lib/python2.7/site-packages/zc/buildout/easy_install.py", line 635, in install
    for_buildout_run=for_buildout_run):
  File "/srv/Projects/test/plone/bar/local/lib/python2.7/site-packages/zc/buildout/easy_install.py", line 477, in _get_dist
    dist, avail = self._satisfied(requirement)
  File "/srv/Projects/test/plone/bar/local/lib/python2.7/site-packages/zc/buildout/easy_install.py", line 234, in _satisfied
    return None, self._obtain(req, source)
  File "/srv/Projects/test/plone/bar/local/lib/python2.7/site-packages/zc/buildout/easy_install.py", line 420, in _obtain
    if _final_version(dist.parsed_version)
  File "/srv/Projects/test/plone/bar/local/lib/python2.7/site-packages/zc/buildout/easy_install.py", line 1407, in _final_version
    return not parsed_version.is_prerelease
AttributeError: 'tuple' object has no attribute 'is_prerelease'

Works here. without any `requirements.txt'

    jensens@minime:~/workspace/footest$ vi buildout.cfg
    jensens@minime:~/workspace/footest$ virtualenv .
    New python executable in ./bin/python
    Installing setuptools, pip...done.
    jensens@minime:~/workspace/footest$ ./bin/pip install zc.buildout
    Downloading/unpacking zc.buildout
      Downloading zc.buildout-2.5.0-py2.py3-none-any.whl (261kB): 261kB downloaded
    Downloading/unpacking setuptools>=8.0 (from zc.buildout)
      Downloading setuptools-20.2.2-py2.py3-none-any.whl (508kB): 508kB downloaded
    Installing collected packages: zc.buildout, setuptools
      Found existing installation: setuptools 2.2
        Uninstalling setuptools:
          Successfully uninstalled setuptools
    Successfully installed zc.buildout setuptools
    Cleaning up...
    jensens@minime:~/workspace/footest$ ./bin/buildout 
    Setting socket time out to 3 seconds.
    Creating directory '/home/workspacejensens/footest/parts'.
    Creating directory '/home/workspacejensens/footest/develop-eggs'.
    Getting distribution for 'setuptools==0.6c11'.
    Got setuptools 0.6rc11.
    Upgraded:
      zc.buildout version 1.7.1,
      setuptools version 0.6rc11;
    restarting.
    Generated script '/home/workspacejensens/footest/bin/buildout'.
    Setting socket time out to 3 seconds.
    Unused options for buildout: 'unzip'.
    Installing instance.
    Generated script '/home/workspacejensens/footest/bin/instance'.
    Generated interpreter '/home/workspacejensens/footest/parts/instance/bin/interpreter'.
    Generated script '/home/workspacejensens/footest/bin/pilconvert.py'.
    Generated script '/home/workspacejensens/footest/bin/pilprint.py'.
    Generated script '/home/workspacejensens/footest/bin/pildriver.py'.
    Generated script '/home/workspacejensens/footest/bin/pilfont.py'.
    Generated script '/home/workspacejensens/footest/bin/pilfile.py'.
    jensens@minime:~/workspace/footest$ 

tested the same with ./bin/pip install -U zc.buildout and works too.

Hm, interesting, it is here still not working, even in a new dir I get errors:

Installing 'plone.recipe.zope2instance'.
We have no distributions for plone.recipe.zope2instance that satisfies 'plone.recipe.zope2instance==4.2.18'.
Could't load zc.buildout entry point default
from plone.recipe.zope2instance:
'tuple' object has no attribute 'is_prerelease'.

I will try later something else :slightly_smiling:

Thanks, at least I know now, that it is not my buildout

I usually do this to debug buyildout problems:
./bin/python -m pdb ./bin/buildout

Now you are in a pdb and you cat set breakpoints and debug who what is happening there.

Anyway I usually pip install the latest zc.buildout (2.5.0, which has way better version conflict reporting) and the latest setuptools.
I still did not try the latest one (20.2.2) but other 20.x version were working fine.

1 Like

To be sure I tested that on another location:
Different machine, different data center, different OS, same error:

 Installing.
  Getting section instance.
  Initializing section instance.
  Installing recipe plone.recipe.zope2instance.
  Getting distribution for 'plone.recipe.zope2instance==4.2.18'.
...
...
AttributeError: 'tuple' object has no attribute 'is_prerelease'

Not sure anymore, guess I will try the UI-Installer next :slightly_smiling:

@alert thanks for the tip !

Same error on Fedora 23, following @jensens approach step by step

Fixed !

Reason was the order of stuff in buildout.cfg, I changed it to:

[buildout]
extensions = buildout.threatlevel
extends = http://dist.plone.org/release/4-latest/versions.cfg
versions = versions

parts = instance

[instance]
recipe = plone.recipe.zope2instance
user = admin:admin
http-address = 8080
shared-blob = on
eggs =
        Plone
        Pillow

and now it is working

You can also run buildout -D
for debugging :slight_smile:

1 Like