py2exe and win32com.shell

James Carroll jim at oublic.org
Wed Oct 3 16:21:47 EDT 2001


I'm trying to create a stand-alone executable that creates shortcuts
on the computer.  I am using the link.py sample which uses
win32com.shell.shell to read and write .lnk files.  I'm creating the
executable with py2exe (which ROCKS for command line and wxPython
applications.)

I have tried --force-include --package --include options with all
variations of the com library names.

When I use a python shell to import ( 'from win32com.shell import
shell' ) and type shell, it tells me it is in win32com.shell.shell
I cannot import this using --include or --package when I run px2exe. 
It tells me that the package doesn't exist or it couldn't include the
file.

During the px2exe I get:

warning: py2exe: *************************************************
**********
warning: py2exe: * The following modules were not found:
warning: py2exe: *   riscosenviron
warning: py2exe: *   win32dbg
warning: py2exe: *   win32com.client.NeedUnicodeConversions
warning: py2exe: *   win32dbg.dbgcon
warning: py2exe: *   ce
warning: py2exe: *   win32com.client.Dispatch
warning: py2exe: *   riscos
warning: py2exe: *   win32com.shell
warning: py2exe: *   riscospath
warning: py2exe: *************************************************

and when I run my program, I get:

c:\jimc\python\dist\link>link
Traceback (most recent call last):
  File "<string>", line 4, in ?
  File "imputil.pyc", line 127, in _import_hook
  File "<string>", line 60, in _finish_import
  File "imputil.pyc", line 305, in _load_tail
ImportError: No module named win32com.shell

If I try ' --force-inculde win32com ' I get the same result.


If I try ' --force-inculde win32com.shell '
     or  ' --force-inculde win32com.shell.shell ' I get:
  ImportError: No module named win32com.shell
very early in the py2exe process


What am I missing????
Thanks,
-Jim



More information about the Python-list mailing list