could someone please tell me why I am getting this error after converting my Python file into an executable?
The Error :
Traceback (most recent call last):
File "MD2HTML.py", line 11, in <module>
File "tkinter\__init__.py", line 2109, in iconbitmap
_tkinter.TclError: bitmap "icon.ico" not defined
[5572] Failed to execute script 'MD2HTML' due to unhandled exception!
[process exited with code 1]
Pyinstaller command:
pyinstaller --onefile --icon=icon.ico MD2HTML.py
My code:
from tkinter import messagebox
import markdown
from tkinter import *
def go():
result = markdown.markdown(md.get("0.1",END))
root.clipboard_append(result)
messagebox.showinfo("Information", "HTML CODE COPIED SUCCESSFULLY")
root = Tk()
root.iconbitmap("icon.ico")
root.geometry("700x510")
root.title("MD2HTML")
root.config(bg="black")
title = Label(root, text="MD-2-HTML",bg="#20B2AA",fg="white",font = ("Cascadia Code", 25))
title.pack(fill=X)
information = Label(root, text="Enter Your MD Code To Convert To HTML",bg = "black", fg="white")
information.pack(fill=X)
md = Text(root,borderwidth=0,bg = "#222222",fg = "white", insertbackground="#20B2AA",font=("Cascadia Code",9))
md.pack(pady=10)
go = Button(root, text = "Convert", border=0, command=go, bg = "lightgreen", activebackground="cyan")
go.pack(pady=2)
root.mainloop()
OS: Windows
Python: 3.10
Thank you!
PS: In my code editor, that is VSCode, it's working fine...