[python-win32] Re: py2exe 0.5 and WMI?

Thomas Heller theller at python.net
Mon Feb 23 15:26:49 EST 2004


"Stefan Holmgren" <stefan.holmgren at accalon.se> writes:

> At first... I'm new to py2exe.... the McMillian Installer is not working.
> I'm running py2exe on windows XP with this
>     options = {"py2exe": {"typelibs":
>                           # typelib for WMI
>                           [('{565783C6-CB41-11D1-8B02-00600806D9B6}', 0, 1,
> 2)],
>
> it is working well on that mashine.....
>
> When i'm trying to run my new exe-file on windows 2000 i got an error:
>
> Traceback (most recent call last):
>   File "wxApp1.py", line 6, in ?
>   File "wxFrame1.pyo", line 9, in ?
>   File "wmi.pyo", line 132, in ?
>   File "win32com\client\gencache.pyo", line 527, in EnsureDispatch
>   File "win32com\client\CLSIDToClass.pyo", line 50, in GetClass
> KeyError: '{76A6415C-CB41-11D1-8B02-00600806D9B6}'
> -------------------------------------------------------------------------
>
> Then when I rerun py2exe on my windows 2000, I have to change last digit in
> option to , 1:
>     options = {"py2exe": {"typelibs":
>                           # typelib for WMI
>                           [('{565783C6-CB41-11D1-8B02-00600806D9B6}', 0, 1,
> 1)],
>
> ok, how can I make this exe-file to work on both XP and 2000??

I don't know if this is really the 'right' thing to do, but it seems to
me that there are different typelibs on win2k and XP.  You could try to
copy the win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x1
directory from the win2k machine to the XP machine, and build the exe
there.

options should then probably be set to this:

     options = {"py2exe": {"typelibs":
                   # typelibs for WMI
                   [('{565783C6-CB41-11D1-8B02-00600806D9B6}', 0, 1, 1),
                    ('{565783C6-CB41-11D1-8B02-00600806D9B6}', 0, 1, 2)],


A totally different idea would be to create the makepy wrappers on the
target machine, but I'm quite sure that doesn't work currently.

If you find a solution (or even if not), it would be nice if you submit
a short recipe to the py2exe wiki for people having similar problems.

Thomas




More information about the Python-win32 mailing list