PyImagingPhoto

Hal Knight knight@cpi.com
Thu Nov 21 00:05:42 GMT 2024


Here is an update. At the following link, it says that the problem was 
fixed in Pillow version 9.0.0.dev0:
https://github.com/friedrichromstedt/bughunting-02/tree/v2021-11-05_2?tab=readme-ov-file#proposal-of-a-fix-from-upstream

My Pillow version is 8.4.0. I tried to upgrade to more recent versions 
of Pillow using pip, but it bombed.

Perhaps the problem is that cygwin's python tkinter package is using 
Pillow 8.4.0. I don't know how to upgrade it.

What I am really trying to do is to use the matplotlib plotting 
capability in python.

The following generates the error:

import matplotlib.pyplot as plt
plt.plot([1,2,3,4])

I am not going to be able to use python through cygwin if this doesn't 
get solved.

As the URLs show, someone fixed it, but I don't know how to get the fix.

On 11/19/2024 8:30 PM, Hal Knight wrote:
> I get the following error in python run from a cygwin xterm window:
>
> Traceback (most recent call last):
>   File "/usr/lib/python3.8/site-packages/PIL/ImageTk.py", line 176, in 
> paste
>     tk.call("PyImagingPhoto", self.__photo, block.id)
> _tkinter.TclError: invalid command name "PyImagingPhoto"
>
> I just installed the following:
> python38 3.8.16-1
> python38-imaging-tk 8.1.2-1
> python38-matplotlib 3.5.1-1
>
> I get the same error that was discussed earlier here:
>
> https://github.com/python-pillow/Pillow/issues/5795
>
> There, the following python code was said to cause the error:
> import tkinter
> from PIL import Image, ImageTk
> image = Image.new('RGB', (100, 100))
> tk = tkinter.Tk()
> canvas = tkinter.Canvas(tk)
> canvas.pack()
> photoimage = ImageTk.PhotoImage(image)
>
> I get the same error from this. The above #5795 page seems to say that 
> the problem was fixed here:
> https://github.com/python-pillow/Pillow/pull/5807
>
> I don't see how the above #5807 link helps me, however.
>
> I am running python from an XTerm window obtained using startxwin.
>
> It appears that something that was fixed in the past (i.e., the error 
> reported at the above 5795 URL) is broken again. Could someone check 
> to see whether they get the above error? Would it help to update other 
> cygwin packages besides the ones listed above? Most of my cygwin 
> packages are from late 2021.
>
> Thanks.



More information about the Cygwin mailing list