Before creating a post I tried to solve my problem by searching and reading through other users errors when it came to the "pyimage1" doesnt exist and i couldn't apply that to my code in order for it to work efficiently.
I'm not too sure what to try anymore at this point in order to get these buttons some photos! i've read through loads of threads from other people with the same problem but i just can't get it to work.
error code:
Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\korey\AppData\Local\Programs\Python\Python38\lib\tkinter__init__.py", line 1883, in call return self.func(*args) File "C:/Users/korey/PycharmProjects/test rental/gui test.py", line 186, in car_menu_screen Button(text="Coupe", height="15", width="75", command=login, image=coupephoto).place(x=420, y=220) File "C:\Users\korey\AppData\Local\Programs\Python\Python38\lib\tkinter__init__.py", line 2645, in init Widget.init(self, master, 'button', cnf, kw) File "C:\Users\korey\AppData\Local\Programs\Python\Python38\lib\tkinter__init__.py", line 2567, in init self.tk.call( _tkinter.TclError: image "pyimage1" doesn't exist
def car_menu_screen():
global car_menu
main_screen.destroy() # Closes the main screen (login or register)
car_menu = Tk()
car_menu.geometry("1920x1080") # Sets Window Size
car_menu.title("Vehicle Choice Menu") # Sets Window Title
Label(text="What Type Of Vehicle Would You Like to Rent?", bg="red", width="300", height="2",
font=("Arial Black", 13)).pack()
Label(text="").pack()
coupephoto = PhotoImage(file="coupe.png")
sedanphoto = PhotoImage(file="sedan.png")
suvphoto = PhotoImage(file="suv.png")
sportsphoto = PhotoImage(file="sports.png")
Button(text="Coupe", image=coupephoto, height="150", width="350", command=login).place(x=420, y=220)
Label(text="").pack()
Button(text="Sedan", image=sedanphoto, height="150", width="350", command=register).place(x=960, y=220)
Label(text="").pack()
Button(text="SUV", image=suvphoto, height="150", width="350", command=register).place(x=420, y=500)
Label(text="").pack()
Button(text="Sports", image=sportsphoto, height="150", width="350", command=register).place(x=960, y=500)