TypeError: 'Version' object has no attribute '__getitem__'

The annoying @#$!@#$ problem I've had the last few days is solved by

pip install setuptools==38.5.1

(or bin/pip install setuptools==38.5.1 depending on your setup)

It seems that setuptools 39.0.1 is messed up.

I had been getting this error running buildout:

$ bin/buildout
Develop: '/Users/kim/src/uwosh.oie.studyabroadstudent/.'
Updating _mr.developer.
Installing instance.
While:
  Installing instance.

An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
  File "/Users/kim/src/uwosh.oie.studyabroadstudent/lib/python2.7/site-packages/zc/buildout/buildout.py", line 2127, in main
    getattr(buildout, command)(args)
  File "/Users/kim/src/uwosh.oie.studyabroadstudent/lib/python2.7/site-packages/zc/buildout/buildout.py", line 797, in install
    installed_files = self[part]._call(recipe.install)
  File "/Users/kim/src/uwosh.oie.studyabroadstudent/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1557, in _call
    return f()
  File "/Users/kim/.buildout/eggs/plone.recipe.zope2instance-4.2.22-py2.7.egg/plone/recipe/zope2instance/__init__.py", line 95, in install
    major, minor = parsed[0:2]
TypeError: 'Version' object has no attribute '__getitem__'
5 Likes
1 Like

Pin setuptools to 38.7.0 until https://github.com/plone/plone.recipe.zope2instance/issues/37 is resolved.

zc.buildout last version already fixed that, the problem is with plone.recipe.zope2instance.

1 Like

I get the same problem but with Plone 5.0.8 using the training module https://training.plone.org/5/theming/theme-package.html

(buildoutvenv)root@www:/opt/plone5/ploneconf.theme# ./bin/buildout
.....
Installing _mr.developer.
Generated script '/opt/plone5/ploneconf.theme/bin/develop'.
Installing instance.
While:
Installing instance.

An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
File "/opt/plone5/buildoutvenv/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1995, in main
getattr(buildout, command)(args)
File "/opt/plone5/buildoutvenv/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 666, in install
installed_files = self[part]._call(recipe.install)
File "/opt/plone5/buildoutvenv/local/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1410, in _call
return f()
File "/opt/plone5/ploneconf.theme/eggs/plone.recipe.zope2instance-4.2.22-py2.7.egg/plone/recipe/zope2instance/init.py", line 95, in install
major, minor = parsed[0:2]
TypeError: 'Version' object has no attribute 'getitem'

(buildoutvenv)root@www:/opt/plone5/ploneconf.theme# ./bin/buildout
Upgraded:
setuptools version 24.3.0;
restarting.
Generated script '/opt/plone5/ploneconf.theme/bin/buildout'.
Upgraded:
setuptools version 24.3.0;
restarting.
Upgraded:
setuptools version 24.3.0;
restarting.
Upgraded:
setuptools version 24.3.0;
restarting.
Upgraded:
setuptools version 24.3.0;
restarting.


I can only interrupt with Ctrl-C because here is an endless loop.

requirements.txt:
setuptools == 24.3.0
zc.buildout == 2.5.3

See also Problem with buildout Plone 5.08

This has been solved in plone.recipe.zope2instance 4.4.0 which can be used in Plone 4.3, 5.0, 5.1.

6 Likes