[Image-SIG] Re: Broken PIL

Fredrik Lundh fredrik at pythonware.com
Tue Jun 10 21:19:34 EDT 2003

Larry Bates wrote:

> All of the sudden I'm getting an odd error/traceback when I try to use
> PIL.  I recently downloaded and installed 1.1.4a3 (Windows installer
> version).  I did patch this with the PcxImagePlugin that Fredrick
> sent me last week.
> Below is a sample program and traceback that I'm getting.  It doesn't
> seem to matter if I change the output format to JPG (e.g. I get the
> same traceback).

>     return apply(decoder, (mode,) + args + extra)
> TypeError: function takes exactly 2 arguments (3 given)

the usual cause for this problem is that Python is picking up the
PIL Python files for one PIL version, and the _imaging module for
another one.

(in this case, it looks like newer Python files, and an old _imaging

try this:

    >>> import Image
    >>> print Image.__file__
    >>> import _imaging
    >>> print _imaging.__file__

and make sure that the output is what you expect.

if you cannot sort it out, get rid of all _imaging.dll and _imaging.pyd
files in the Python tree (and if necessary, the application tree), and


More information about the Image-SIG mailing list