#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Posts
    2
    Rep Power
    0

    Zope, Python and win32com loading


    Hi anybody

    I'm getting Error: module win32com.client not found.

    I'm Loading in an Extended Module as follows:

    import win32com.client
    o=win32com.client.Dispatch('App.Class")

    (Zope V2.7, Python V2.34 and pyWin32-202 Win32 py2.3 installed.)

    Much appreciated
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2004
    Location
    London, England
    Posts
    1,585
    Rep Power
    1373
    It may be because Zope installs and uses its own version of Python, so any extensions that you have installed on a regular version of Python will not be found.

    You will need to install the win32all extensions into the Zope directory tree.

    Dave - The Developers' Coach
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Posts
    2
    Rep Power
    0

    Resolved


    Dave

    Thanks for the pointer. It seems to be that. (Althought I think win32 detect the installation by itself and then install to that subfolder.)
    I've instead added a Directive in the zope.conf as follows that points to the path of the win32 installation:

    path C:/Program Files/Python/Lib/site-packages

    This solved the 'module not loaded' error but resulted in CoInitialize Error.

    The following seems to solve the error completely:
    (althought much about single thread/multi thread dynamics still need to be decided, this is for each thread executed)

    def GetName(sName=""):
    import pythoncom
    import win32com.client
    pythoncom.CoInitialize()
    o=win32com.client.Dispatch("ZopeTest.cTest")
    b=o.GetName(sName)
    return b
    pythoncom.CoUninitialize()

    Kind Regards

IMN logo majestic logo threadwatch logo seochat tools logo