flexiabler Titel Rotating Header Image

Plone (buildout) verliert Dateien – ImportError: No module named … (Windows only)

Windows erlaubt sich hin und wieder (wann und warum konnte ich noch nicht raus finden) Files im eggs Verzeichnis des buildouts zu löschen. Unter Linux/Mac passiert dies nicht! Ich vermute es liegt an den Symlinks (junction.exe) welche Windows in Verbindung mit omelette durcheinander bringen. Beim Starten der Instanz findet Plone dann benötigte Module nicht mehr:

2010-03-30 10:10:41 ERROR Application Could not import Products.FCKeditor
Traceback (most recent call last):
  File "D:\dev\test\parts\zope2\lib\python\OFS\Application.py", line 709, in im
port_product
    product=__import__(pname, global_dict, global_dict, silly)
  File "d:\dev\test\eggs\products.fckeditor-2.6.3.test.0.1-py2.4.egg\Products\FC
Keditor\__init__.py", line 5, in ?
    from Products.CMFCore.DirectoryView import registerDirectory
ImportError: No module named CMFCore.DirectoryView
Traceback (most recent call last):
  File "D:\dev\test\parts\instance-dev\bin\servicewrapper.py", line 140, in ?
    run.run()
  File "D:\dev\test\parts\zope2\lib\python\Zope2\Startup\run.py", line 21, in r
un
    starter.prepare()
  File "D:\dev\test\parts\zope2\lib\python\Zope2\Startup\__init__.py", line 102
, in prepare
    self.startZope()
  File "D:\dev\test\parts\zope2\lib\python\Zope2\Startup\__init__.py", line 278
, in startZope
    Zope2.startup()
  File "D:\dev\test\parts\zope2\lib\python\Zope2\__init__.py", line 47, in star
tup
    _startup()
  File "D:\dev\test\parts\zope2\lib\python\Zope2\App\startup.py", line 45, in s
tartup
    OFS.Application.import_products()
  File "D:\dev\test\parts\zope2\lib\python\OFS\Application.py", line 686, in im
port_products
    import_product(product_dir, product_name, raise_exc=debug_mode)
  File "D:\dev\test\parts\zope2\lib\python\OFS\Application.py", line 709, in im
port_product
    product=__import__(pname, global_dict, global_dict, silly)
  File "d:\dev\test\eggs\products.fckeditor-2.6.3.test.0.1-py2.4.egg\Products\FC
Keditor\__init__.py", line 5, in ?
    from Products.CMFCore.DirectoryView import registerDirectory
ImportError: No module named CMFCore.DirectoryView

Schaut man in eggs/Products.CMFCore nach, sieht man das dort keine Files mehr vorhanden sind.

Als sichere Lösung empfiehlt es sich die Files von buildout neu erstellen zu lassen:

  1. Im buildout directory das parts / bin und eggs Verzeichnis löschen
  2. “python bootstrap.py” neu ausführen
  3. “bin/buildout” ausführen

Nun sollte buildout alle eggs neu laden und installieren. Außerdem wird Zope und die Instance neu erstellt.

Wer die Ursache kennt, kann es mir gern mitteilen :)

Ähnliche Beiträge:

  1. Beschleunigung Zope im Debug Mode (nur unter Windows)
  2. Quick and a little dirty: Add TinyMCE & remove Kupu in Plone 3
  3. Erstellen von Python Eggs per setuptools (in 3 Minuten)

2 Comments

  1. Florian Schulze says:

    If omelette is actually using ntfs junctions, then the reason is simple. If buildout thinks the omelette part needs an update, then it will remove the omelette directory recursively. Since ntfs junctions are like hard links, the contents of those directories are deleted. On Linux/OS X omelette uses normal symlinks which will be removed instead of their content. Using junctions is dangerous if you don’t know how they work.

  2. Gomez says:

    Thanks Florian for the explanation.

    Yes, omelette need junctions on windows :(

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Comments links could be nofollow free.