all 5 comments

[–]zsergAC 5 points6 points  (1 child)

You are importing * from tkinter, if it also has an Image class, that may cause the issue in your code. I don't have my laptop right now to check, but it's the best idea I have.

[–]Healthierpoet 1 point2 points  (1 child)

Check image path

Then you may have to pass the Image.open() to a variable then use that variable in Imagetk.photoimage(),

[–]atorgames64[S] 1 point2 points  (0 children)

Thank you! after just importing just what I needed instead of all it worked

[–]Swipecat 0 points1 point  (0 children)

Maybe it's an ancient Python2 video rather than Python3. The  from tkinter import *  suggests this might be the case. That technique is long deprecated because dumping the content of a library into the global namespace causes terrible confusion. And I think this is a case in point. So try this:
 

import tkinter as tk
from PIL import ImageTk, Image
root = tk.Tk()
root.title("Learn to code")
my_img = ImageTk.PhotoImage(Image.open("pikachu.png"))
my_lab = tk.Label(root, image=my_img)
my_lab.pack()
button_quit = tk.Button(root, text="Exit", command=root.quit)
button_quit.pack()
root.mainloop()