zopeskel fails (can't import urllib.parse)

233 views Asked by At

I fail to install a usable version of zopeskel in my Plone site, both in my Debian-based Linux box and on the CentOS-based server.

In my buildout.cfg I have, following this how-to:

[zopeskel]
recipe = zc.recipe.egg
unzip = true
eggs =
    ZopeSkel <= 3.0dev
    Paste
    PasteDeploy
    PasteScript
#    ${buildout:eggs}

(I don't have Dexterity contents nor diazothemes for now, so I tried without the zopeskel.dexterity and zopeskel.diazotheme, but it doesn't seem to make a difference; same result when I add them). My [buildout] section doesn't contain eggs, so I needed to comment out this as well.

After building I tried

$ bin/zopeskel --list
Traceback (most recent call last):
  File "bin/zopeskel", line 15, in <module>
import zopeskel.zopeskel_script
  File ".../eggs/ZopeSkel-2.21.2-py2.7.egg/zopeskel/__init__.py", line 2, in <module>
from zopeskel.basic_namespace import BasicNamespace
  File ".../eggs/ZopeSkel-2.21.2-py2.7.egg/zopeskel/basic_namespace.py", line 2, in <module>
from zopeskel.vars import var, DottedVar, StringVar, BooleanVar, TextVar
  File ".../eggs/ZopeSkel-2.21.2-py2.7.egg/zopeskel/vars.py", line 2, in <module>
from paste.script.templates import var as base_var
  File ".../eggs/PasteScript-2.0.2-py2.7.egg/paste/script/templates.py", line 7, in <module>
from . import copydir
  File ".../eggs/PasteScript-2.0.2-py2.7.egg/paste/script/copydir.py", line 6, in <module>
from six.moves.urllib.parse import quote
ImportError: No module named urllib.parse
$ grep six bin/zopeskel
    '.../eggs/six-1.2.0-py2.7.egg',

This is a quite old version (pip install six gave me 1.9.0), and it doesn't contain anything like quote or urllib.parse.

I assume some involved package fails to specify a needed version; but adding something like six >= 1.3 didn't even build.

How can I fix this? Thank you!

2

There are 2 answers

1
Godefroid Chapelle On BEST ANSWER

I guess the 1.2.0 version of the six package is specified by one of the extends of your buildout.

You could use buildout annotate to find which one it is.

You need to add a versions section:

[versions]
six = 1.9.0
2
Danimal On

Let it fail!

Seriously, ditch zopeskel for mrbob and this template....

zopeskel/paster are now seen as unmaintainable in the long run (due to dependencies that are not been worked on at all. mrbob has no major dependencies and is the approach that Plone 5 universal installer is taking instead of zopeskel.

But to make it more practical: zopeskel & it's plugins give issues like your one pretty regularly, mrbob does not in my experience. Because it is maintained it will also produce more up to date "model code" than zopeskel will.

Admittedly, mrbob doesn't (yet) have the number of plugins that zopeskel does, but since archetypes has been overtaken by dexterity, there is less heavy "boilerplate code" to generate. It's your choice, but if you are starting Plone now - then just learn one of mrbob or zopeskel (There's enough other stuff to learn).

Install it like this (obviously you have to add mrbob to your parts list too)

[mrbob]
recipe = zc.recipe.egg:scripts
eggs =
    mr.bob
    bobtemplates.plone