py2exe odbc:cannot import dbi module

Marc Ederis mederis at
Thu Mar 4 12:37:36 CET 2004

Great, it works, thanks Thomas!

But why did you say that odbc32.dll shouldn't be distributed? Because
our distribution should only contain python specific files?
If that's the reason, then I should probably take out MFC42.dll too,
right? Well, I'll just take them out and test... I guess I should
really familiarize myself with distutils, so I understand more about
all this!


Thomas Heller <theller at> wrote in message news:<mailman.49.1078254551.12614.python-list at>...
> It seems you have to first explicitely import the dbi module before the
> odbc module can be imported.
> """
> import dbi, odbc
> """
> py2exe doesn't know that dbi.dll is a python extension - it is only
> found as binary dependency.  And you should not (must not?) distribute
> odbc32.dll, which is also copied to the dist folder.
> In py2exe 0.5, you *should* be able to specify
>    dll_exludes = ["odbc32.dll"]
> but this doesn't seem to work.
> Thomas

More information about the Python-list mailing list