Endless loop installing Plone using a minimal buildout

Installing Plone using a minimal buildout produces an endless loop:

I'm using debian11 (bulleye) with Python 3.9.2. But I get the same problem with Python 2.7.18`

cd ~
rm -rf ~/Plone-5
mkdir ~/Plone-5
cd ~/Plone-5
python -m virtualenv zinstance
cd zinstance/
bin/pip install zc.buildout
echo """
[buildout]
extends =
    http://dist.plone.org/release/5-latest/versions.cfg

parts =
    instance

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

""" > buildout.cfg
bin/buildout

This enters a endless loop:

created virtual environment CPython2.7.18.final.0-64 in 148ms
  creator CPython2Posix(dest=/home/map/Plone-5/zinstance, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, wheel=bundle, setuptools=bundle, via=copy, app_data_dir=/home/map/.local/share/virtualenv)
    added seed packages: pip==20.3.4, setuptools==44.1.1, wheel==0.37.1
  activators NushellActivator,PythonActivator,FishActivator,CShellActivator,PowerShellActivator,BashActivator
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting zc.buildout
  Using cached zc.buildout-2.13.6-py2.py3-none-any.whl (154 kB)
Requirement already satisfied: setuptools<52,>=8.0 in ./lib/python2.7/site-packages (from zc.buildout) (44.1.1)
Installing collected packages: zc.buildout
Successfully installed zc.buildout-2.13.6
Creating directory '/home/map/Plone-5/zinstance/eggs'.
Creating directory '/home/map/Plone-5/zinstance/parts'.
Creating directory '/home/map/Plone-5/zinstance/develop-eggs'.
Getting distribution for 'zc.buildout==2.13.4'.
Got zc.buildout 2.13.4.
Getting distribution for 'setuptools==42.0.2'.
Got setuptools 42.0.2.
Upgraded:
  zc.buildout version 2.13.4,
  setuptools version 42.0.2;
restarting.
Generated script '/home/map/Plone-5/zinstance/bin/buildout'.
Upgraded:
  zc.buildout version 2.13.4,
  setuptools version 42.0.2;
restarting.
Generated script '/home/map/Plone-5/zinstance/bin/buildout'.
Upgraded:
  zc.buildout version 2.13.4,
  setuptools version 42.0.2;
restarting.
Upgraded:
  zc.buildout version 2.13.4,
  setuptools version 42.0.2;
restarting.
Upgraded:
  zc.buildout version 2.13.4,
  setuptools version 42.0.2;
restarting.
...
^C

Ensure that the versions for zc.buildout and setuptools in your requirements.txt match the versions used by the Plone version to be installed. Check the related versions.cfg (as this one for Plone 5.2.7).

If you're just testing Plone, You can also use pip based installation: https://github.com/plone/plone-backend#plone-52-stable-plone

@zopyx Thank you very much. Mentioning the requirements.txt was very helpful.
Then the order of pip installing makes a difference!

Don't do it in this order: Because zc.buildout will install a newer version of setuptools

# ./bin/pip install 'setuptools==42.0.2' --force-reinstall
# ./bin/pip install 'zc.buildout==2.13.4' --force-reinstall

Right order: if you don't want to use requirements.txt

./bin/pip install 'zc.buildout==2.13.4' --force-reinstall
./bin/pip install 'setuptools==42.0.2' --force-reinstall
1 Like

I add here the working steps:

PLONE_RELEASE=5.2.7
PLONE_HOME=~/Plone-${PLONE_RELEASE}
cd ~
rm -rf ${PLONE_HOME}
mkdir ${PLONE_HOME}
cd ${PLONE_HOME}
python -m virtualenv zinstance
cd ${PLONE_HOME}/zinstance/

# the following searchs for the specified versions of 'zc.buildout' and 'setuptools' 
# and add them to `requirements.txt`
curl -s "https://dist.plone.org/release/${PLONE_RELEASE}/versions.cfg" \
    | sed -n -e 's/^\(zc\.buildout\|setuptools\) *= *\(.*\)$/\1==\2/p' \
    | tee requirements.txt
# setuptools==42.0.2
# zc.buildout==2.13.4

${PLONE_HOME}/zinstance/bin/pip install -r requirements.txt

cat <<EOF | tee ${PLONE_HOME}/zinstance/buildout.cfg
[buildout]
extends =
    http://dist.plone.org/release/${PLONE_RELEASE}/versions.cfg
parts =
    instance
[instance]
recipe = plone.recipe.zope2instance
user = admin:admin
http-address = 8080
eggs =
    Plone
EOF
${PLONE_HOME}/zinstance/bin/buildout \
    -c ${PLONE_HOME}/zinstance/buildout.cfg
2 Likes