Plone 5.1 Installation Abort: AttributeError: 'module' object has no attribute 'SetuptoolsVersion'

The following traceback was from an installation attempt on Ubuntu 16.04.4. This was with the Plone 5.1 Unified Installer, with the following root install command:

$sudo -H ./install.sh standalone --target="/opt/plone" --clients=2

The result was a buildout that failed. Here is the traceback from the install.log file:

Detailed installation log
Starting at Sat Mar 17 19:48:16 UTC 2018
Processing ./zc.buildout-2.11.1.tar.gz
Requirement already satisfied: setuptools>=8.0 in /opt/plone/zinstance/lib/python2.7/site-packages (from zc.buildout==2.11.1)
Building wheels for collected packages: zc.buildout
Running setup.py bdist_wheel for zc.buildout: started
Running setup.py bdist_wheel for zc.buildout: finished with status 'done'
Stored in directory: /root/.cache/pip/wheels/81/0d/eb/3a2a35251f992f044241685d3e3cf24d058dd4e8d27bebd020
Successfully built zc.buildout
Installing collected packages: zc.buildout
Successfully installed zc.buildout-2.11.1
Traceback (most recent call last):
File "/opt/plone/zinstance/bin/buildout", line 7, in
from zc.buildout.buildout import main
File "/opt/plone/zinstance/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 18, in
import zc.buildout.easy_install
File "/opt/plone/zinstance/local/lib/python2.7/site-packages/zc/buildout/easy_install.py", line 45, in
pkg_resources.SetuptoolsVersion(setuptools_version) >=
AttributeError: 'module' object has no attribute 'SetuptoolsVersion'

python-setuptools is the current version for Ubuntu 16.04.4 (version 20.7.0-1). Do I need a newer version?

sudo apt -s install python-setuptools
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-setuptools is already the newest version (20.7.0-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

I have never tried to use the unified installer as sudo, but I'm not surprised that it can fail horribly.
Probably as you guessed Plone will try to use the system libraries and fail it there is a compatibilty problem. If you install as non root (as shown on docs.plone.org) Plone will install its own version for setuptools, for the record for Plone 5.0 it's 35.2. Strangely for another Plone installer it's 26.1 with Plone 5.1. Anyway, it's more recent that your Ubuntu version.

I'd guess that you can try to update setuptools by hand. I just checked with Duckduckgo and people do it with sudo pip, even if the first result boils down to 'don't do it'. Obviously it will create a computer state inconsistent with the system update tools, something you may live with if you don't care.
IMO Unified installer is good for initiation or maybe development, both cases where non sudo installation is best. For production it may not be the best option. I've a strong liking to Ansible Plone, not so much more complex to setup than Unified installer and bringing 10x more. FTR Ansible Plone has no problem with Ubuntu 16 LTS at all, even if you may have to install first python.

Try running bin/buildout a second time, this might work:

sudo -u plone_buildout /opt/plone/zinstance/bin/buildout

This is off my head, so I might be "barking up the wrong tree".

You've hit a bug. The installer is intended to work with this platform and with 'sudo'. Please file a ticket at https://github.com/plone/Installers-UnifiedInstaller/issues will these details. We'll fix it.

The installer is intended to work with or without 'sudo'. The only difference that 'sudo' makes is that the installer will use the extra rights to create special users and will set the permissions of files to match.

With or without sudo, the installer uses virtualenv to create the Python environment. It does not fiddle with -- or use -- the system version of setuptools.

It turns out that the versions of setuptools and zc.buildout that ship in the installer are incompatible. We'll fix that.

Meanwhile, you may get running with:

cd /opt/plone/zinstance
sudo bin/pip install setuptools==38.7.0
sudo -u plone_buildout bin/buildout

Folks who aren't using sudo may do the same fix by just changing to their install directory and using the same commands without 'sudo' or 'sudo -u plone_buildout'.

Okay, it is item #71. Thanks!

There's a new version of the installer uploaded to https://launchpad.net/plone/5.1/5.1.0/+download/Plone-5.1.0-UnifiedInstaller-r2.tgz that contains the fix. Thanks for the report!

yes it goes all the way to a working site. It's just a bit strange that the default values for the new site are US english language and Berlin timezone though.

The beauty of the community. Fixed in 24hrs. Well done folks!

1 Like

Well Done Indeed! I hold this example up to others interested in Plone but not believing that an open source product cannot be properly supported.