R: Py2exe beginner troubles
Thomas Heller
thomas.heller at ion-tof.com
Fri Sep 28 15:30:28 EDT 2001
"Fabrizio" <facelle at jumpy.it> wrote in message news:9p2btn$1p5$1 at serv1.albacom.net...
> Thanks for your reply, but I still cannot get it to work.
>
> This is my program (it's a basic one which I got from the tutorial. It gets
> all .jpg files in a directory, create thumbnails for them and copy them into
> another place with a different file extension) which uses PIL :
>
> ############################
>
> import os, sys, glob
> import Image
>
> # I have added the following two lines just trying to get py2exe compatibily
> :
> import BmpImagePlugin, JpegImagePlugin, PngImagePlugin
> import SgiImagePlugin, SunImagePlugin, TgaImagePlugin, TiffImagePlugin
>
> dir = os.getcwd ()
> for infile in glob.glob("*.jpg"):
> file = os.path.join(dir,infile)
> outfile = os.path.splitext(file)[0] + ".thj"
> if infile != outfile:
> try:
> im = Image.open(infile)
> im.thumbnail((180, 135))
> im.save(outfile, "JPEG", quality=95)
> # im.show()
> except IOError:
> print "Could not create thumbnail for image ", infile
>
> #############################
>
>
> And this is the error I get from py2exe :
>
> --------------------------------
>
> Resolving binary dependencies:
> error: tcl83.dll: No such file or directory
>
> -------------------------------
Probably you don't have Tkinter installed.
PIL uses Tkinter, but can live without it.
You should be able to build your exe with the excludes
command-line flag:
python setup.py "--excludes=Tkinter,_imagingtk"
Oh, and by the way: as long as you only use jpeg images,
I guess you don't have to include BmpImagePlugin, TiffImagePlugin
and so on.
Thomas
More information about the Python-list
mailing list