davork
davork

Reputation: 179

PyInstaller not displaying .png img when it creates an exe file

I have a code that creates GUI using Tkinter but when I try to run PyInstaller and I create an exe file my .png image is missing from the app:

self.logo = PhotoImage(file = 'img01.png')

ttk.Label(self.frame_header, image = self.logo, ).grid(row = 0, column = 0, 
rowspan = 2)

ttk.Label(self.frame_header, text = 'Static Data App!',style = 
'Header.TLabel').grid(row = 0, column = 1)

ttk.Label(self.frame_header, wraplength = 400,
text = ("Just click on the buttons one by one and follow the 
logic")).grid(row = 1, column = 1)

ttk.Label(self.frame_header, image = self.logo, ).grid(row = 0, column = 3, 
rowspan = 2)

self.frame_content = ttk.Frame(master)
self.frame_content.pack()

The output I receive when I try to run exe file is "img.png no such file od directory" even though the img gets displayed when I run my app from the script.

Upvotes: 1

Views: 776

Answers (1)

adejongh93
adejongh93

Reputation: 22

Are you copying the images folder to the dist folder where the .exe is?

Upvotes: 1

Related Questions