I was making a GUI with python Tkinter. It also uses numpy and matplotlib also. So, I used pyinstaller and make a exe out of the python script. It runs flawlessly and did all what i wanted. Then I tried to change the tk icon from the gui window (i am using windows 10) with this line
master.iconbitmap(default='image.ico')
other than this line i change nothing of the main program. Then using pyinstaller and I made the exe without any error. But when I tried to run the exe it shows "Fatal Error! file.exe returned -1" What am i missing? How to fix this problem?
Also I have an additional problem, the 1st exe i build (without changing the icon) is running on Windows-10 and Windows-8 but not in Windows-7. In windows-7 it shows the same error "Fatal Error! file.exe returned -1"
Your problem (most likely) is that you are not bundling the icon's image when using pyinstaller to compile your program to a .exe.
You'll see something like this in your .spec file:
Or you could do something like
try setting datas like:
from: http://pythonhosted.org/PyInstaller/spec-files.html#adding-data-files
datas is a list of tuples: (source, dest)