this works perfectly before but suddenly starts giving me this error on vscode. I have tried all the solutions i have seen online, but doesnt yet work, please who cn help
#create a class that holds the app most background frame. it contains nothing in itself except the #menu. But all other pages are called forward onto it
class SeaofBTCapp(Tk):
def __init__(self, *args, **kwargs):
Tk.__init__(self, *args, **kwargs)
#to add an icon image to the app has to be .ico file
Tk.iconbitmap(self, default='C:/Users/aurel/Desktop/image.ico')
#set title
Tk.wm_title(self, 'InteL-Trader')
self.state("zoomed") #window alway loads full
global screen_height
global screen_width
global one_part
global two_part
screen_width=self.winfo_screenwidth()
screen_height=self.winfo_screenheight()
#percentage unit of the screen width
one_part=(16.36/100*screen_width)
#percentage unit of the screen height
two_part=10/100*screen_height
#the is the whole app container untop of root screen(Self).
Whole_App_Frame=Frame(self, width=screen_width, height=screen_height, bg='gold')
Whole_App_Frame.grid(row=0, column=0, columnspan=3)
################################################
#Menus
################################################
#create the menu container on the app background frame
my_menu=Menu(Whole_App_Frame)
#display the menu as your menu that tkinter should treat as such
self.config(menu=my_menu)
def Stop_bot(): #function to trigger the cloud code to stop
pass
file_menu=Menu(my_menu)
my_menu.add_cascade(label="Home", menu=file_menu)
file_menu.add_command(label="Home Page", command=lambda: controller.show_frame(StartPage))
file_menu.add_separator()
file_menu.add_command(label="Log out MT5 Account", command=Stop_bot)
file_menu.add_separator()
file_menu.add_command(label="Exit", command=Whole_App_Frame.quit)
#create menu option forAccount ####################################################################################################
Account_menu=Menu(my_menu)
my_menu.add_cascade(label="Account", menu=Account_menu)
Account_menu.add_command(label="Account Data Page", command=lambda: controller.show_frame(AccountPage))
Account_menu.add_separator()
Account_menu.add_command(label="Receipts|Reports|Statements Downloads", command=lambda: controller.show_frame(DownloadsPage))
#create menu option for Training ###################################################################################################
Training_menu=Menu(my_menu)
my_menu.add_cascade(label="Training", menu=Training_menu)
Training_menu.add_command(label="How to use Intel Trader", command=lambda: controller.show_frame(HowtoIntel))
Training_menu.add_separator()
Training_menu.add_command(label="Forex basics", command=lambda: controller.show_frame(ForexBasics))
Training_menu.add_separator()
Training_menu.add_command(label="Advanced Forex analysis and Strategies", command=lambda: controller.show_frame(AdvancedForex))
#create menu option for Help #########################################################################################################
help_menu=Menu(my_menu)
my_menu.add_cascade(label="Help Centre", menu=help_menu)
help_menu.add_command(label="Self Help Centre", command=lambda: controller.show_frame(CommunityHelpPage))
help_menu.add_separator()
help_menu.add_command(label="Contact US", command=lambda: controller.show_frame(ContactsPage))
help_menu.add_separator()
help_menu.add_command(label="Direct Message and Calls", command=lambda: controller.show_frame(CallPage))
#create menu option for Terms and Conditions without cascades and the function #############################################################
my_menu.add_command(label="Terms and Conditions", command=lambda: controller.show_frame(TermsPage))
self.frames={}
#, DownloadsPage, HowtoIntel, ForexBasics, AdvancedForex, CommunityHelpPage, CallPage, ContactsPage, TermsPage, PageOne, PageTwo, PageThree
for F in (StartPage, AccountPage): #this will contain all the pageframes and we can bring up any one at will with button calls
frame=F(Whole_App_Frame, self)
self.frames[F]=frame
frame.grid(row=0, column=0, sticky='nswe')
self.show_frame(StartPage) #start page is automatically loaded as the default page to be automatically displayed
def show_frame(self, cont): # this function searches the self.frames dictionary and moves up the page we want
frame=self.frames[cont]
frame.tkraise()
##################################################################################################################################################################
##################################################################################################################################################################
#make startpage class
class StartPage(Frame):
def __init__(self, parentclass, controller):
Frame.__init__(self, parentclass)
#################################create the first column frame using the percentage of total screen width and height######################################
#logo and APP name frame##################################################################################
Logo_screen_frame=LabelFrame(self, width=int(one_part), height=int(two_part), bg='green')
Logo_screen_frame.grid(column=0, row=0, padx=2, pady=0, sticky='n', columnspan=2, rowspan=1)
#create a logo file in on the page of the app ############################################################
logo=Image.open("C:/Users/aurel/trading app/logo1.PNG")
logo=logo.resize((int(one_part/3), int(two_part-15)))
ph=ImageTk.PhotoImage(logo)
label=Label(Logo_screen_frame, image=ph)
label.image=ph
label.grid(row=0, column=0)
......
app=SeaofBTCapp()
app.geometry(str(screen_width)+'x'+str(screen_height))
ani=animation.FuncAnimation(f, animate, interval=1000)
app.mainloop()
File "c:Usersaureltrading appfreshtutorial.py", line 793, in <module>
app=SeaofBTCapp()
^^^^^^^^^^^^^
File "c:Usersaureltrading appfreshtutorial.py", line 205, in __init__
frame=F(Whole_App_Frame, self)
^^^^^^^^^^^^^^^^^^^^^^^^
File "c:Usersaureltrading appfreshtutorial.py", line 234, in __init__
label=Label(Logo_screen_frame, image=ph)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:Python312Libtkinter__init__.py", line 3237, in __init__
Widget.__init__(self, master, 'label', cnf, kw)
File "C:Python312Libtkinter__init__.py", line 2648, in __init__
self.tk.call(
_tkinter.TclError: image "pyimage18" doesn't exist
PS C:Usersaureltrading app>
I was expecting to display image logo within a frame called logo_screen_frame but i got the error above. This same was working perfectly a few hours ago. Please if u have any idea where i gone wrong or what to fix, let me know. All codes are written in vscode