4

I'm trying to use paster to create a dexterity content type. I did a new standalone installation of Plone 4.3.4 in a target folder that's different from the one I was previously working with so it was buildout-cache would be clean.

The OS I am using is Ubuntu 14.04. So in my downloads folder, in the installer's folder I extracted, I type in the terminal:

./install.sh --target=/home/myusername/Plone2 --instance=MyProject standalone

That installs correctly. Then I go to MyProject in Plone2. I edit the buildout to change my password, and the run buildout:

buildout -c develop.cfg

Then I goto the src folder and create a new product with zopeskel:

../bin/zopeskel dexterity project.house

Then I edit my buildout and under eggs I add project.house and under develop, src/project.house. Then I run buildout again and it builds out correctly. Then in the project.house folder under sources, I try running paster.

../../bin/paster addcontent dexterity_content

Then I end up with an error:

Traceback (most recent call last):
  File "../../bin/paster", line 264, in <module>
    sys.exit(paste.script.command.run())
  File "/home/pjdowney/Plone2/buildout-cache/eggs/PasteScript-1.7.5-py2.7.egg/paste/script/command.py", line 104, in run
    invoke(command, command_name, options, args[1:])
  File "/home/pjdowney/Plone2/buildout-cache/eggs/PasteScript-1.7.5-py2.7.egg/paste/script/command.py", line 143, in invoke
    exit_code = runner.run(args)
  File "/home/pjdowney/Plone2/buildout-cache/eggs/PasteScript-1.7.5-py2.7.egg/paste/script/command.py", line 238, in run
    result = self.command()
  File "/home/pjdowney/Plone2/buildout-cache/eggs/ZopeSkel-2.21.2-py2.7.egg/zopeskel/localcommands/__init__.py", line 70, in command
    self._extend_templates(templates, args[0])
  File "/home/pjdowney/Plone2/buildout-cache/eggs/ZopeSkel-2.21.2-py2.7.egg/zopeskel/localcommands/__init__.py", line 204, in _extend_templates
    tmpl = entry.load()(entry.name)
  File "/home/pjdowney/Plone2/buildout-cache/eggs/setuptools-7.0-py2.7.egg/pkg_resources.py", line 2184, in load
    ['__name__'])
ImportError: No module named dexterity.localcommands.dexterity

I did recently install Plone 4.3.6 in another target folder. Unfortunately, I never tried using paster because I was creating dexterity content through the web. Could switching to 4.3.6 have ruined everything?

My earlier target folder works still though.

Patrick Downey
  • 965
  • 8
  • 13
  • 1
    You're question, if "switching to Plone-4.3.6 could have ruined everything", raises the quest to me, if it worked for you with lower UnifiedInstallers versions? Another thing I'd try, is to downgrade setuptools to the next lower version you have, for the reasons given in my answer below. – Ida Sep 17 '15 at 08:10

2 Answers2

3

Throwing ""ImportError: No module named dexterity.localcommands.dexterity" + "plone" into a searchengine leads straight to Plone 4.3.4 - ImportError: No module named dexterity.localcommands.dexterity where S. McMahon states it's a bug reported in https://github.com/plone/Installers-UnifiedInstaller/issues/33 and already fixed for Plone-5-installers, but not for Plone-4.

The bug is likely caused of the newest setuptools-version and FWIW, I accidentally found these infos one day in the tweets of "glyph", which look helpful:

"Public Service Announcement: make @dstufft’s life easier, and do not use the `python-pip´ package from Debian or Ubuntu. It’s broken." (1)

"Instead, install pip and virtualenv with get-pip.py, ideally into your home directory. (Sadly, https://pip2014.com/ is still relevant.)" (2)

I will have a closer look at the salvation-promising-script get-pip.py, when running into probs again, but for now, I simply don't upgrade anything :-D

(1)https://twitter.com/glyph/status/640980540691234816 (2)https://twitter.com/glyph/status/640980540691234816

Community
  • 1
  • 1
Ida
  • 3,994
  • 21
  • 40
  • Thanks for the explanatory answer. I appreciate it. So it was an issue with setuptools. I pinned the version of setuptools to 2.2 under versions in buildout.cfg and it works. I should have tried that first based on the second to last line in the traceback. Yeah, I'll try to hold off on upgrading for now since I'm still working on a project. Thank you again! – Patrick Downey Sep 17 '15 at 10:58
1

(copied from my own comment on a similar issue in github)

I've had fights like this in the past with zopeskel / paster. Nowadays though I avoid it.... choosing to use:

  • mrbob for templating eggs
  • creating dexterity types through the web see plone training
  • OR alternatively creating dexterity types directly in code without templating - there's a lot less boilerplate code in dexterity cf archetypes

I suspect your issue is because your install of 4.3.6 may have upgraded zopeskel or one of it's dependencies to something with different requirements on localcommands/templates. If you want to continue this fight (and I don't recommend it), then you could try pinning all your zopeskel dependencies to latest versions (though Zopeskel has to be less than 3.0 I believe)

Danimal
  • 1,208
  • 10
  • 21
  • Thank you. For now I set setuptools to 2.2, which fixed the issue I was having. I'll switch to using mrbob at some point since I could be causing other issues by pinning versions of other products. Plus mrbob is deprecating paster according to link on mrbob you provided. Thank you again. – Patrick Downey Sep 17 '15 at 12:12
  • That's a good idea, paster/zopeskel will become less & less supported - I would say that you should make the switch to mrbob when you start a new project (like now). It's refreshingly simple & the templates will more likely be more accurate than the paster ones. Give yourself 10-15 minutes to try it now & see what you think! – Danimal Sep 17 '15 at 16:11
  • Is mrbob safe of possibly having conflicts like we're constantly encountering with paster'n'zopskel? – Ida Sep 18 '15 at 05:33
  • @IdaEbkes I guess it's not bulletproof, but it has far less dependencies than paster http://mrbob.readthedocs.org/en/latest/other.html – Danimal Sep 18 '15 at 09:27
  • @Danimal: Hm, looking in its setup.py, it actually has far more dependencies than paster, but the important thing is probably about how much continuous <3 a module gets :-) Have a nice weekend! – Ida Sep 19 '15 at 07:09
  • @IdaEbkes fair points. And the more complexity the more <3 reqd - and templer modules & their dependencies don't seem to be getting as much as they need. – Danimal Sep 21 '15 at 09:55