I just start to write a small script which contain a query about
current process and using win32com.client.
The script is like this:
import win32com.client
try:
WMI = win32com.client.GetObject('winmgmts:')
p = WMI.ExecQuery('select * from Win32_Process where
Name="target.exe"')
except:
write log
it woks fine, when I run it as a script, but when I pack it into one
file using pyinstaller 1.3 and run it, I got exception log like this
CRITICAL Unexpected error: <class 'pywintypes.com_error'>
if I change the call to WMI =
win32com.client.GetObject('winmgmts:',clsctx=pythoncom.CLSCTX_LOCAL_SERVER)
according to mannual
I still got this:
Unexpected error: <class 'pywintypes.com_error'>
And I get warn txt as following:
W: no module named MacOS (conditional import by py_compile)
W: no module named wx.ImageFromStream (top-level import by
taskbaricon)
W: no module named pwd (delayed, conditional import by posixpath)
W: no module named org (top-level import by pickle)
W: no module named wx.BitmapFromImage (top-level import by titleicon)
W: no module named fcntl (conditional import by subprocess)
W: no module named optik.__version__ (top-level import by optparse)
W: no module named wx.ImageFromStream (top-level import by titleicon)
W: no module named readline (delayed import by pdb)
W: no module named wx.EmptyIcon (top-level import by titleicon)
W: no module named pwd (delayed import by getpass)
W: no module named posix (delayed, conditional import by iu)
W: no module named EasyDialogs (conditional import by getpass)
W: no module named termios (top-level import by getpass)
W: no module named org (top-level import by copy)
W: no module named fcntl (top-level import by tempfile)
W: no module named readline (delayed, conditional import by cmd)
W: no module named wx.EmptyIcon (top-level import by taskbaricon)
W: no module named win32com.client._get_good_object_ (top-level import
by win32com.client.util)
W: no module named ic (delayed import by urllib)
W: no module named _emx_link (conditional import by os)
W: no module named posix (conditional import by os)
W: no module named optik.__all__ (top-level import by optparse)
W: no module named wx.BitmapFromImage (top-level import by
taskbaricon)
W: no module named rourl2path (conditional import by urllib)
W: no module named SOCKS (top-level import by ftplib)
W: no module named Carbon (conditional import by tempfile)
W: delayed exec statement detected at line 0 - bdb (C:\Python25\lib
\bdb.pyc)
W: delayed eval hack detected at line 0 - bdb (C:\Python25\lib
\bdb.pyc)
W: delayed eval hack detected at line 0 - bdb (C:\Python25\lib
\bdb.pyc)
W: __all__ is built strangely at line 0 - optparse (C:
\Python25\pyinstaller-1.3\optparse.pyc)
W: __all__ is built strangely at line 0 - tokenize (C:\Python25\lib
\tokenize.pyc)
W: delayed __import__ hack detected at line 0 - pickle (C:
\Python25\lib\pickle.pyc)
W: delayed __import__ hack detected at line 0 - pickle (C:
\Python25\lib\pickle.pyc)
W: delayed conditional eval hack detected at line 0 - gopherlib (C:
\Python25\lib\gopherlib.pyc)
W: delayed __import__ hack detected at line 0 - encodings (C:
\Python25\lib\encodings\__init__.pyc)
W: __all__ is built strangely at line 0 - dis (C:\Python25\lib
\dis.pyc)
W: delayed __import__ hack detected at line 0 -
win32com.server.policy (C:\Python25\lib\site-packages\win32com\server
\policy.pyc)
W: top-level exec statement detected at line 0 - hashlib (C:
\Python25\lib\hashlib.pyc)
W: top-level conditional exec statement detected at line 0 - hashlib
(C:\Python25\lib\hashlib.pyc)
W: delayed conditional eval hack detected at line 0 - warnings (C:
\Python25\lib\warnings.pyc)
W: delayed conditional __import__ hack detected at line 0 - warnings
(C:\Python25\lib\warnings.pyc)
W: delayed conditional eval hack detected at line 0 - autodownloading
(C:\Users\guojc\Documents\Python\AutoDownloading\autodownloading.pyc)
W: delayed __import__ hack detected at line 0 - email (C:\Python25\lib
\email\__init__.pyc)
W: __all__ is built strangely at line 0 - wx (C:\Python25\lib\site-
packages\wx-2.8-msw-unicode\wx\__init__.pyc)
W: __all__ is built strangely at line 0 - wx (C:\Python25\lib\site-
packages\wx-2.8-msw-unicode\wx\__init__.pyc)
W: delayed exec statement detected at line 0 - pdb (C:\Python25\lib
\pdb.pyc)
W: delayed conditional eval hack detected at line 0 - pdb (C:
\Python25\lib\pdb.pyc)
W: delayed eval hack detected at line 0 - pdb (C:\Python25\lib
\pdb.pyc)
W: delayed conditional eval hack detected at line 0 - pdb (C:
\Python25\lib\pdb.pyc)
W: delayed eval hack detected at line 0 - pdb (C:\Python25\lib
\pdb.pyc)
W: delayed conditional exec statement detected at line 0 - iu (C:
\Python25\pyinstaller-1.3\iu.pyc)
W: delayed conditional exec statement detected at line 0 - iu (C:
\Python25\pyinstaller-1.3\iu.pyc)
W: delayed __import__ hack detected at line 0 - optik.option_parser
(C:\Python25\pyinstaller-1.3\optik\option_parser.pyc)
W: delayed conditional __import__ hack detected at line 0 - doctest (C:
\Python25\lib\doctest.pyc)
W: delayed exec statement detected at line 0 - doctest (C:
\Python25\lib\doctest.pyc)
W: __all__ is built strangely at line 0 - optik (C:
\Python25\pyinstaller-1.3\optik\__init__.pyc)
W: delayed exec statement detected at line 0 -
win32com.client.dynamic (C:\Python25\lib\site-packages\win32com\client
\dynamic.pyc)
W: delayed conditional __import__ hack detected at line 0 - unittest
(C:\Python25\lib\unittest.pyc)
W: delayed conditional __import__ hack detected at line 0 - unittest
(C:\Python25\lib\unittest.pyc)
W: delayed exec statement detected at line 0 - socket (C:\Python25\lib
\socket.pyc)
W: delayed conditional __import__ hack detected at line 0 -
win32com.client.gencache (C:\Python25\lib\site-packages\win32com\client
\gencache.pyc)
W: delayed __import__ hack detected at line 0 -
win32com.client.gencache (C:\Python25\lib\site-packages\win32com\client
\gencache.pyc)
W: delayed eval hack detected at line 0 - os (C:\Python25\lib\os.pyc)
W: __all__ is built strangely at line 0 - __future__ (C:\Python25\lib
\__future__.pyc)
W: delayed __import__ hack detected at line 0 -
win32com.client.makepy (C:\Python25\lib\site-packages\win32com\client
\makepy.pyc)
W: delayed eval hack detected at line 0 - gettext (C:\Python25\lib
\gettext.pyc)
Any suggestion is welcome. Thanks in advance
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"PyInstaller" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/PyInstaller?hl=en
-~----------~----~----~----~------~----~------~--~---