From: Mark H. <mha...@sk...> - 2006-07-24 23:50:59
|
> Has anyone had problems with Py2exe 0.6.5 and python 2.4 and > registering COM servers? > > I've a complex graphics project with a client and com server > component that I've built a py2exe distribution for. With Py2exe > 0.5.4 and python 2.3, I'm able to build a distributable executable. > But when I do essentially the same build using py2exe 0.6.5 and > python 2.4 the compilation appears to work; but when I try to > register the com server I get the following error: > > Traceback (most recent call last): > File "boot_com_servers.py", line 44, in ? > ImportError: dynamic module does not define init function (initDDV_GS007) > > where "DDV_GS007" is the name of my com server. The com server class > does have an __init__ method but I don't know where the request for > an init<servername> comes from -- it wasn't requested in earlier versions. This is probably a consequence of a bug in the most recent py2exe that means sys.path includes the py2exe directory when it should not. You could try and earlier version of py2exe, or the CVS version (which has it fixed), or modify your script so the very first thing it does is to check if len(sys.path)==2, and if so, nuke entry zero (although that is probably *not* a permanent solution - future py2exe versions may create a valid sys.path with len > 1. Hope this helps, Mark |