Search code examples
plonepasterzopeskel

Plone/Paster - What could cause "paster addcontent dexterity_content" to not work?


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.


Solution

  • 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