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

S.Holmgren stefan_holmgren at msn.com
Fri Feb 27 15:44:20 EST 2004


Thomas Heller wrote:
> "Stefan Holmgren" <stefan.holmgren at accalon.se> writes:
> 
> 
>>Hi, Thomas...
>>
>>I made this thing to work, but I don't think it's a nice way to solve it...
>>
>>.. At first I did a setup.py py2exe as below on my XP.
>>.. Then I opened the shared.zip and extracted all
>>'win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x2' files
>>.. and renamed them to
>>'win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x1'
>>.. appended the new structur into the zip-file..
>>.. In shared.zip I now got same files doubled
>>'win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x2' and
>>'win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x1'
>>
>>Hope u understand what I have done!
>>This is working for me....
>>/Holmis
> 
> 
> Stefan, I thought of this:
> 
> Assuming you want to create the exe on the XP machine:
> 
> Go to the win2k machine, run your program there, and a folder named
>   win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x1
> should be created.  This contains the makepy generated Python wrappers
> for version 1.1 of the wmi typelibs.
> 
> Copy this folder to the XP machine, which should now have both the
> folders
>   win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x1
> and
>   win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x2
> 
> Now, change your setup script so that wrappers for both typelibs are
> included:
>       options = {"py2exe": {"typelibs":
>                     # typelibs for WMI
>                     [('{565783C6-CB41-11D1-8B02-00600806D9B6}', 0, 1, 1),
>                      ('{565783C6-CB41-11D1-8B02-00600806D9B6}', 0, 1, 2)],
> and build the exe by running the setup script.
> 
> Now you should have an exe which should be able to run on both 2k and XP
> machines.
> 
> Probably you did something having the same effect.
> 
> Thomas

Hi again....
ok, Thomas thanks for your fast reply and support, but...
py2exe don't like your ide....

I copied the folder:
win32com\gen_py\565783C6-CB41-11D1-8B02-00600806D9B6x0x1x1
from 2k to my XP machine..
I now got these 2 folders under win32com\gen_py\
py2exe says:

Traceback (most recent call last):
   File "C:\MyProgs\Python\SHtimer\setup.py", line 155, in ?
     windows = [test_wx],
   File "C:\Python23\lib\distutils\core.py", line 149, in setup
     dist.run_commands()
   File "C:\Python23\lib\distutils\dist.py", line 907, in run_commands
     self.run_command(cmd)
   File "C:\Python23\lib\distutils\dist.py", line 927, in run_command
     cmd_obj.run()
   File "C:\Python23\Lib\site-packages\py2exe\build_exe.py", line 180, 
in run
     self.typelibs)
   File "C:\Python23\Lib\site-packages\py2exe\build_exe.py", line 1058, 
in collec
t_win32com_genpy
     mod = gencache.GetModuleForTypelib(*info)
   File "C:\Python23\lib\site-packages\win32com\client\gencache.py", 
line 250, in
  GetModuleForTypelib
     mod = _GetModule(modName)
   File "C:\Python23\lib\site-packages\win32com\client\gencache.py", 
line 616, in
  _GetModule
     mod = __import__(mod_name)
ImportError: No module named 565783C6-CB41-11D1-8B02-00600806D9B6x0x1x1

ok...I can use my solution to modify the the shared.zip
after I have made a dist with py2exe....

/ Holmis




More information about the Python-win32 mailing list