wxPython+py2exe+win98 ImportError: DLL load failed: A device attached to the system is not functioning

Clark C. Evans cce at clarkevans.com
Wed Mar 7 10:38:15 CET 2001


Hello.  I've recently discovered py2exe and wanted to give
it a test run (I'm looking for a good software distribution
system for Python on Windoz).  

I was able to make an executable of a command-line python
program, and it workes just great on my Win2K development
box, and my Win98 install.  Further, I was able to create a
wxPython program (the first example from the wxpython.org
tutorial) and it works great on Win2K.  However, the
executable created gives the following error when I run it
on a fresh copy of Win98:                         

  Traceback (most recent call last):
    File "<string>", line 1, in ?
    File "imputil.pyc", line 88, in _import_hook
    File "<string>", line 20, in _import_top_module
    File "imputil.pyc", line 197, in import_top
    File "imputil.pyc", line 252, in _import_one
    File "<string>", line 95, in _process_result
    File "wxPython\__init__.pyc", line 20, in ?
    File "imputil.pyc", line 78, in _import_hook
    File "imputil.pyc", line 323, in _do_import
    File "imputil.pyc", line 248, in _import_one
    File "<string>", line 130, in get_code
  ImportError: DLL load failed: A device attached to
               the system is not functioning.

I was wondering if other people have the same problem
or if I'm doing something wrong here.  Thanks!  Clark Evans

..................................................
THE MINIMAL COMMAND LINE SCRIPT (I'm new to python)
.................................................
import sys
for line in sys.stdin.readlines():
  print line

..................................................
THE WXPYTHON SCRIPT
..................................................
from wxPython.wx import *

class MyApp(wxApp):
    def OnInit(self):
        frame = wxFrame(NULL, -1, "Hello from wxPython")
        frame.Show(true)
        self.SetTopWindow(frame)
        return true

app = MyApp(0)
app.MainLoop()

....................................................
THE SETUP SCRIPT
.....................................................

from distutils.core import setup
import py2exe

setup(name="myscript",
      scripts=["myscript.py"],
)

..................................................
THE WXPYTHON SCRIPT DIRECTORY CREATED BY PY2EXE
..................................................
03/07/2001  02:44a             199,458 myscript.exe
10/26/2000  01:00p           3,715,072 wxc.pyd
12/07/1999  04:00a             295,000 MSVCRT.dll
10/19/2000  11:30a             667,728 python20.dll
10/21/2000  08:52p           1,917,952 wx22_2.dll
12/07/1999  05:00a              77,878 MSVCIRT.dll

..................................................
DLLs LOADED BY THE COMMAND LINE EXE UNDER WIN2K
...................................................
C:\temp\dist\myscr\python20.dll 
F:\WINNT\system32\ADVAPI32.dll 
F:\WINNT\system32\COMCTL32.DLL 
F:\WINNT\System32\ctype.nls 
F:\WINNT\system32\GDI32.DLL 
F:\WINNT\System32\IMM32.DLL 
F:\WINNT\system32\KERNEL32.dll 
F:\WINNT\System32\locale.nls 
F:\WINNT\system32\MSVCRT.dll 
F:\WINNT\System32\ntdll.dll 
F:\WINNT\system32\RPCRT4.DLL 
F:\WINNT\system32\SHELL32.dll 
F:\WINNT\system32\SHLWAPI.DLL 
F:\WINNT\System32\sortkey.nls 
F:\WINNT\System32\sorttbls.nls 
F:\WINNT\System32\unicode.nls 
F:\WINNT\system32\USER32.dll 

..................................................
ADDITIONAL DLLs LOADED VIA THE wxPython EXE
..................................................

C:\temp\dist\myscript\wx22_2.dll 
F:\WINNT\System32\sbpcir32.dll 
C:\temp\dist\myscript\wxc.pyd 
F:\WINNT\System32\sbpcint4.dll 
F:\WINNT\System32\WS2HELP.DLL 
F:\WINNT\System32\WS2_32.dll 
F:\WINNT\system32\LZ32.DLL 
F:\WINNT\System32\WINMM.dll 
F:\WINNT\system32\VERSION.dll 
F:\WINNT\system32\ole32.dll 
C:\temp\dist\myscript\MSVCIRT.dll 

.....................................................
THE RUN OF THE PY2EXE SCRIPT
.....................................................

C:\temp>python setup.py py2exe
running py2exe
running build
running build_scripts
copying myscript.py -> build\scripts
running install_scripts
creating build\bdist.win32\winexe
creating build\bdist.win32\winexe\lib
creating build\bdist.win32\winexe\lib\Program Files
creating build\bdist.win32\winexe\lib\Program Files\Python
creating build\bdist.win32\winexe\lib\Program Files\Python\Scripts
copying build\scripts\myscript.py -> build\bdist.win32\winexe\lib\Program
Files\
Python\Scripts
copying build\scripts\myscr.py -> build\bdist.win32\winexe\lib\Program
Files\Pyt
hon\Scripts
copying build\scripts\myscrip.py -> build\bdist.win32\winexe\lib\Program
Files\P
ython\Scripts
warning: install: modules installed to
'build\bdist.win32\winexe\lib\Program Fil
es\Python\', which is not in Python's module search path (sys.path) --
you'll ha
ve to change the search path yourself
+------------------------------
| Processing script myscript.py
+------------------------------
creating build\bdist.win32\winexe\collect
creating build\bdist.win32\winexe\collect\myscript
creating build\bdist.win32\winexe\collect\myscript\Scripts
Searching modules needed to run 'myscript.py' on path:
['C:\\temp\\build\\bdist.win32\\winexe\\lib\\Program Files\\Python', '',
'c:\\te
mp', 'f:\\program files\\python', 'f:\\program files\\python\\installer',
'f:\\p
rogram files\\python\\wxpython', 'f:\\program files\\python\\pythonwin',
'f:\\pr
ogram files\\python\\win32', 'f:\\program files\\python\\win32\\lib',
'f:\\progr
am files\\python\\dlls', 'f:\\program files\\python\\lib', 'f:\\program
files\\p
ython\\lib\\plat-win', 'f:\\program files\\python\\lib\\lib-tk']
force_imports =
ext_mapping = {
 'wxPython.wxc': ('wxc.pyd', ('.pyd', 'rb', 3))
}
Resolving binary dependencies:
  F:\WINNT\System32\NTDLL.DLL
  f:\program files\python\wxPython\wxc.pyd
  F:\WINNT\System32\KERNEL32.dll
  F:\WINNT\System32\RPCRT4.DLL
  F:\WINNT\System32\MSVCRT.dll
  F:\WINNT\System32\WINMM.dll
  F:\WINNT\System32\USER32.dll
  F:\WINNT\System32\COMCTL32.DLL
  F:\WINNT\System32\SHLWAPI.DLL
  F:\WINNT\System32\python20.dll
  F:\WINNT\System32\SHELL32.dll
  F:\WINNT\System32\GDI32.DLL
  f:\program files\python\wxPython\wx22_2.dll
  F:\WINNT\System32\ADVAPI32.dll
  f:\program files\python\py2exe\run.exe
  F:\WINNT\System32\MSVCIRT.dll
copying f:\program files\python\py2exe\support.py ->
build\bdist.win32\winexe\co
llect\myscript\Scripts
byte-compiling f:\program files\python\wxPython\clip_dnd.py to
wxPython\clip_dnd
.pyc
byte-compiling f:\program files\python\wxPython\gdi.py to wxPython\gdi.pyc
byte-compiling f:\program files\python\wxPython\mdi.py to wxPython\mdi.pyc
byte-compiling f:\program files\python\wxPython\__version__.py to
wxPython\__ver
sion__.pyc
byte-compiling f:\program files\python\wxPython\__init__.py to
wxPython\__init__
.pyc
byte-compiling f:\program files\python\wxPython\frames.py to
wxPython\frames.pyc

byte-compiling f:\program files\python\wxPython\streams.py to
wxPython\streams.p
yc
byte-compiling f:\program files\python\wxPython\image.py to
wxPython\image.pyc
byte-compiling f:\program files\python\wxPython\cmndlgs.py to
wxPython\cmndlgs.p
yc
byte-compiling f:\program files\python\wxPython\filesys.py to
wxPython\filesys.p
yc
byte-compiling f:\program files\python\wxPython\misc.py to
wxPython\misc.pyc
byte-compiling f:\program files\python\wxPython\printfw.py to
wxPython\printfw.p
yc
byte-compiling f:\program files\python\wxPython\windows2.py to
wxPython\windows2
.pyc
byte-compiling f:\program files\python\wxPython\windows3.py to
wxPython\windows3
.pyc
byte-compiling f:\program files\python\wxPython\controls2.py to
wxPython\control
s2.pyc
byte-compiling f:\program files\python\lib\types.py to types.pyc
byte-compiling f:\program files\python\wxPython\utils.py to
wxPython\utils.pyc
byte-compiling f:\program files\python\wxPython\events.py to
wxPython\events.pyc

byte-compiling f:\program files\python\lib\imputil.py to imputil.pyc
byte-compiling f:\program files\python\wxPython\wx.py to wxPython\wx.pyc
byte-compiling f:\program files\python\wxPython\misc2.py to
wxPython\misc2.pyc
byte-compiling f:\program files\python\wxPython\sizers.py to
wxPython\sizers.pyc

byte-compiling f:\program files\python\wxPython\windows.py to
wxPython\windows.p
yc
byte-compiling f:\program files\python\lib\string.py to string.pyc
byte-compiling f:\program files\python\wxPython\controls.py to
wxPython\controls
.pyc
byte-compiling f:\program files\python\wxPython\stattool.py to
wxPython\stattool
.pyc
copying myscript.py ->
build\bdist.win32\winexe\collect\myscript\Scripts\__main_
_.py
changing into 'build\bdist.win32\winexe\collect\myscript'
zip -rq C:\temp\build\bdist.win32\winexe\myscript.zip .
creating 'C:\temp\build\bdist.win32\winexe\myscript.zip' and adding '.' to
it
changing back to 'C:\temp'
creating dist\myscript\myscript.exe
copying f:\program files\python\wxPython\wxc.pyd -> dist\myscript
copying F:\WINNT\System32\MSVCRT.dll -> dist\myscript
copying F:\WINNT\System32\python20.dll -> dist\myscript
copying f:\program files\python\wxPython\wx22_2.dll -> dist\myscript
copying F:\WINNT\System32\MSVCIRT.dll -> dist\myscript
warning: py2exe: ***************************************************************
**********
warning: py2exe: * The following modules were not found:
warning: py2exe: *   utilsc
warning: py2exe: *   miscc
warning: py2exe: *   windowsc
warning: py2exe: *   streamsc
warning: py2exe: *   gdic
warning: py2exe: *   framesc
warning: py2exe: *   sizersc
warning: py2exe: *   controls2c
warning: py2exe: *   printfwc
warning: py2exe: *   stattoolc
warning: py2exe: *   misc2c
warning: py2exe: *   controlsc
warning: py2exe: *   windows2c
warning: py2exe: *   eventsc
warning: py2exe: *   windows3c
warning: py2exe: *   clip_dndc
warning: py2exe: *   mdic
warning: py2exe: *   imagec
warning: py2exe: *   cmndlgsc
warning: py2exe: *   filesysc
warning: py2exe: ***************************************************************
**********
removing 'build\bdist.win32\winexe\collect\myscript' (and everything under
it)
removing 'build\bdist.win32\winexe' (and everything under it)






More information about the Python-list mailing list