py2exe + Pmw = my problem

Thomas Heller thomas.heller at ion-tof.com
Mon Apr 30 06:15:50 EDT 2001


"Nick Perkins" <nperkins7 at home.com> wrote in message news:0yOG6.22173$HF.4908876 at news4.rdc1.on.home.com...
>
> I have been trying out py2exe, with excellent success
> 'compiling' programs that use Tkinter.
>
> But when I throw in something from Pmw
> (PythonMegaWidget) module, it doesn't work.


Pmw uses a dynamic loader, which must first be replaced.
See the Pmw documentation:
  Freezing Pmw
  Since the dynamic loader requires that Pmw be installed at run time, it can not
  be used when freezing Pmw. In this case, a single module containing all Pmw code
  is required, which can then be frozen with the rest of the application's modules.
  The bundlepmw.py script in the Pmw bin directory can be used to create such a file.

>
> py2exe finishes, but warns:
> warning: py2exe: * The following modules were not found:
> warning: py2exe: *   ce
>
> ( what the heck is 'ce' ? -- related to 're' ? )
>
Usually you can ignore most of these warnings.
The standard python library contains a lot of code
trying to cover special cases / special platforms,
and expects some of these imports to fail.
Anyway you should test the resulting executable
to make sure that it works as expected. The warnings
may give you some hints where things go wrong...

> ..and the resulting .exe fails, saying
> ...
>     File "Pmw\__init__.pyc", line 34, in ?
> IndexError: list index out of range
See above: The dynamic loader doesn't work.

>
> ..as an aside, i am not even sure how this whole
> 'setup.py' business works. Do i really need to
> understand distutils (i dont), when all i really want
> to do is make a program into an exe?
No.

Thomas





More information about the Python-list mailing list