Using PIL with py2exe

Justin Shaw wyojustin at hotmail.com
Sun Feb 27 21:28:38 EST 2005


"John Carter" <> wrote in message
news:urgetv0v7n1eqoiffhi8533ql9ssmvcq8v at 4ax.com...
> Does anyone know how to embed PIL into a py2exe program.
>
> As far as I can tell PIL is not finding its plugins for Image I/O,
> they are imported dynamically as required. So I cant load or save
> pictures
>
> I tried making a copy of the plugin files to the application
> directory, but I've had no luck in making the code see the files
> I'd be grateful for any suggestion.
>
> Please e-mail me, as well as posting a reply.
>
> John Carter
> jnc at ecs.soton.ac.uk

Just import all of the plugins.  I have this in a file called "plugins.py":


import JpegImagePlugin
import TgaImagePlugin
import PngImagePlugin
import GifImagePlugin
import PcxImagePlugin
import PpmImagePlugin
import BmpImagePlugin
import FliImagePlugin
import EpsImagePlugin
import DcxImagePlugin
import FpxImagePlugin
import ArgImagePlugin
import CurImagePlugin
import GbrImagePlugin
import IcoImagePlugin
import ImImagePlugin
import ImtImagePlugin
import IptcImagePlugin
import McIdasImagePlugin
import MicImagePlugin
import MspImagePlugin
import PcdImagePlugin
import PdfImagePlugin
import PixarImagePlugin
import PsdImagePlugin
import SgiImagePlugin
import SunImagePlugin
import TgaImagePlugin
import TiffImagePlugin
import WmfImagePlugin
import XVThumbImagePlugin
import XbmImagePlugin
import XpmImagePlugin

"John Carter" <> wrote in message
news:urgetv0v7n1eqoiffhi8533ql9ssmvcq8v at 4ax.com...
> Does anyone know how to embed PIL into a py2exe program.
>
> As far as I can tell PIL is not finding its plugins for Image I/O,
> they are imported dynamically as required. So I cant load or save
> pictures
>
> I tried making a copy of the plugin files to the application
> directory, but I've had no luck in making the code see the files
> I'd be grateful for any suggestion.
>
> Please e-mail me, as well as posting a reply.
>
> John Carter
> jnc at ecs.soton.ac.uk





More information about the Python-list mailing list