I have a tkinter based application structured as follows:
import tkinter as tk
class App(tk.Frame):
def __init__(self, master):
self.master = master
tk.Frame.__init__(self, self.master)
self.configure_gui()
self.create_widgets()
def configure_gui(self):
self.master.iconbitmap("my_logo.ico")
self.master.title("Example")
self.master.minsize(250, 50)
def create_widgets(self):
self.label = tk.Label(self.master, text="hello world")
self.label.pack()
if __name__ == "__main__":
root = tk.Tk()
app = App(root)
root.mainloop()
When I run the .py file from the command line, my logo replaces the default tkinter feather logo in the applications main window as expected. I am even able to freeze and bundle my application with pyinstaller using the following command:
pyinstaller -i my_logo.ico my_application.py
Unfortunately, when I attempt to run the .exe file generated by this process I am met with the following error:
Traceback (most recent call last):
File "my_application.py", line 22, in <module>
File "my_application.py", line 7, in __init__
File "my_application.py", line 11, in configure_gui
File "tkinter\__init__.py", line 1865, in wm_iconbitmap
_tkinter.TclError: bitmap "my_logo.ico" not defined
[5200] Failed to execute script my_application
I have scoured this site and others in search of a solution that works in my case and have found none. Any direction would be greatly appreciated!