I am running python 32bit 3.8.4 on Windows 10
I installed pillow with, pip install Pillow but python does not like this
and returns PIL not found
I installed pillow with, pip install Pillow but python does not like this
and returns PIL not found
from tkinter import * from PIL import ImageTk,Image #Tried this as well #from pillow.Image import core as _imaging root = Tk() num = 0 canvas = Canvas(root, width = 1920, height = 1080) img_0 = ImageTk.PhotoImage(Image.open("Photo (1).jpg")) img_1 = ImageTk.PhotoImage(Image.open("Photo (50).jpg)")) def task(): global num canvas.delete("all") canvas.create_text(20,20, text="loop " + str(num)) if num %2 == 0: canvas.create_image(20, 40, anchor=NW, image=img_0) if num %2 == 1: canvas.create_image(20, 40, anchor=NW, image=img_1) num += 1 root.after(2000, task) # reschedule event in 2 seconds canvas.pack() canvas.create_text(20,20, text="hello") root.after(2000, task) root.mainloop()Pillow documentation suggests I should use
from pillow.Image import core as _imagingbut what syntax should I use in this line ?
img_0 = ImageTk.PhotoImage(Image.open("Photo (1).jpg"))Any help appreciated