py2exe: dynamic module does not define init function

Alex Martelli aleax at aleax.it
Mon Sep 22 09:01:25 EDT 2003


Alessandro Crugnola *sephiroth* wrote:

> hi, i have already problems using py2exe..
> i'm using python 2.2, wxPython and audiere for a little mp3 player..
> 
> once I've build the exe with py2exe, when launching the application:
> 
> 
> Traceback (most recent call last):
>   File "<string>", line 9, in ?
>   File "imputil.pyc", line 103, in _import_hook
>   File "<string>", line 52, in _import_top_module
>   File "imputil.pyc", line 216, in import_top
>   File "imputil.pyc", line 267, in _import_one
>   File "<string>", line 163, in get_code
> ImportError: dynamic module does not define init function (initaudiere)
> 
> Sincerely I don't understand the error message..
> can someone explain me the message and if there's a solution?

The message is telling you that audiere.dll does NOT define the
mandatory function named 'initaudiere' which it should absolutely
define to allow the "import audiere" statement.  If the import
works fine outside of a py2exe'd environment but fails in the
latter then I suspect you may be getting the "wrong" DLL in the
second case (e.g. maybe you didn't copy audiere.dll to the
directory in which py2exe's tweaked import expects to find it).


Alex





More information about the Python-list mailing list