I am making a tkiner application and that shows a user a page with some basic information and a picture before allowing them to click a button to view live Bitcoin price data. However, when I added the image to the 'start up' page, I got this error from my IDE:
BTC_img_label = tk.Label(self, image=BTC_img)
File "C:\Python34\lib\tkinter\__init__.py", line 2609, in __init__
Widget.__init__(self, master, 'label', cnf, kw)
File "C:\Python34\lib\tkinter\__init__.py", line 2127, in __init__
(widgetName, self._w) + extra + self._options(cnf))
_tkinter.TclError: image "pyimage10" doesn't exist
I believe that these are the lines of code that are causing my error (they are the same lines that add the image to the 'start up' page):
BTC_img = tk.PhotoImage(file='bitcoin.png')
BTC_img_label = tk.Label(self, image=BTC_img)
BTC_img_label.image = BTC_img
BTC_img_label.grid(row=2, column=0)
I also noticed that the icon that I set does not show in the GUI window when the program is run, only the default Tkinter feather icon. Here's my icon setting code if anyone is interested (though I'm pretty sure it's not causing my error):
tk.Tk.iconbitmap(self, default='main.ico')
And yes, for anyone wondering, I did import tkinter as tk, so that is not my error. If anyone could also tell me why this error happens, I would be very interested: I haven't seen a lot of other examples of this happening, and the ones I have seen had no mention to my icon problem. Hope somebody can figure this out!