[Image-SIG] PIL and py2exe

kevin@cazabon.com kevin at cazabon.com
Sat Aug 27 12:45:20 CEST 2005


When you use py2exe, you can specifically exclude modules - in your setup.cfg file just add a line that says:

excludes=Tkinter, (etc.)

For forcing py2exe to import the format modules, just explicitly import them in your script, or once again, put an "includes" line in the seutp.cfg file for py2exe.


Kevin.
  ----- Original Message ----- 
  From: Sean Curtis 
  To: image-sig at python.org 
  Sent: Tuesday, August 16, 2005 4:49 PM
  Subject: [Image-SIG] PIL and py2exe


  the initialization of PIL does two things that are banging heads with py2exe:

      1) It always imported Tk "just in case".  Even if I'm not using Tk, Tk is imported.  This causes py2exe to load everything in Tk causing my install to get ridiculously huge.  Is there any way around this?

      2) The file format modules are imported on the sly using the __import__ function and constructing the module names at runtime (or at least at compile time.)  Because of this, py2exe doesn't recognize module dependencies and I get a distribution with no file plugins (and thus, the ability to read NOTHING.)

      My gut feeling is that the answer for 1 is what's being done in 2 and the answer to 2 is what's being done in 1.  Is there any around these things other than my hacking my own install of PIL?

  Thanks,

  Sean Curtis


------------------------------------------------------------------------------


  _______________________________________________
  Image-SIG maillist  -  Image-SIG at python.org
  http://mail.python.org/mailman/listinfo/image-sig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/image-sig/attachments/20050827/e91e6fcf/attachment.html


More information about the Image-SIG mailing list