I am trying to embed a folder with images into generated (with PyInstaller) executable. But it doesn't work for me. Even with one simple image!
The datas variable in my main.spec file looks like this:
datas=[ ('C:\\Users\\<user>\\dir1\\dir2\\MyApp\\images\\*.png', 'images') ],
According to the documentation:
The first string specifies the file or files as they are in this system now. The second specifies the name of the folder to contain the files at run-time.
In the python file I read the image like this:
self.SetIcon(wx.Icon("images\\myicon.png"))
Finally, this is how I package everything in the *.exe using PyInstaller:
pyinstaller --onefile --windowed --icon=images\main32x32.ico main.spec
I am getting the following error:
Failed to load image from file "images\myicon.png"
Could someone tell me what I'm doing wrong?