Attention

This document was written for an unsupported version of Plone, Plone 2.1.x, and was last updated 1603 days ago.

For more information, see the version support policy.

To learn how to upgrade to the current version of Plone, read the upgrade manual.

python.exe Unable to locate Component - pywintypes23.dll not found

by Jens W. Klein last modified Dec 30, 2008 03:08 PM
python.exe Unable to locate Component - [..] pywintypes23.dll not found [..]

Zope with Plone on Windows pops up a alert window with the message above.

Reason

The python version has a problem to find a function in the DLL when importing win32api module of Python windows extensions. This module is loaded by PortalTransforms Product for Archetypes 1.3.x shipped with Plone 2.1.x.

Description

PortalTransforms automagically loads available transforms from one mimetype to another and checks it's platform running on for available features.

The word_to_html transform looks for availablity of COM by importing win32com. If this fails the transform is just not available - no reason to worry about. The test for COM availibility itself normally shouldnt affect any user interaction. Unfortunally Windows pops up a dialog-box at this point.

After clicking ok, the Plone/Zope continues starting and works as a production ready application server. It just hasnt a Microsoft Word .doc to HTML converter available.

Solution:

By code manipulation

Surpress checking of word_to_html by commenting the line 20 word_to_html in File 'Products.PortalTransforms.transforms.__init__.py:

   modules = [
    'st',             # zopish
    'rest',           # docutils
    #'word_to_html',   # uno, com, wvware
    'safe_html',      # extract <body> and remove potentially harmful tags
    'html_body',      # extract only the contents of the <body> tag
    'html_to_text',   # re based transform

And in Products.PortalTransforms.libtransforms.utils.py fixate the check for WIN32 to True:

   from sgmllib import SGMLParser

   #try:
   #    import win32api
   #    WIN32 = True
   #except ImportError:
   #    WIN32 = False
   WIN32 = True

   class MissingBinary(Exception): pass

By Windows manipulation

Append the ZOPE_HOME\bin directory to the system-path. This does not work in every case if Zope is started as a service.

Anybody with other success stories: Please let us know and add a comment to this page.