Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pyinstaller setting icons don't change

People also ask

How do I change the icon on PyInstaller?

Use the --icon argument to specify a custom icon for the application. It will be copied into the Resources folder. (If you do not specify an icon file, PyInstaller supplies a file icon-windowed.

How do I change the icon of an exe file?

Right-click the original EXE file (not the copy you made) and choose “Open using Resource Hacker.” In the Resource Hacker window, select the “Icon” folder in the left pane. Click the “Action” menu and then select “Replace Icon.”

How do I fix PyInstaller not working?

To Solve 'pyinstaller' is not recognized as an internal or external command operable program or batch file Error You just need to add python script in your path to solve this error.

What is the difference between py2exe and PyInstaller?

In PyInstaller it is easy to create one exe, By default both create a bunch of exes & dlls. In py2exe its easier to embed manifest file in exe, useful for run as administrator mode in windows vista and beyond. Pyinstaller is modular and has a feature of hooks to include files in the build that you like.


I know this is old and whatnot (and not exactly sure if it's a question), but after searching, I had success with this command for --onefile:

pyinstaller.exe --onefile --windowed --icon=app.ico app.py

Google led me to this page while I was searching for an answer on how to set an icon for my .exe, so maybe it will help someone else.

The information here was found at this site: https://mborgerson.com/creating-an-executable-from-a-python-script


I think this might have something to do with caching (possibly in Windows Explorer). I was having the old PyInstaller icon show up in a few places too, but when I copied the exe somewhere else, all the old icons were gone.


The below command can set the icon on an executable file.

Remember the ".ico" file should present in the place of the path given in "Path_of_.ico_file".

pyinstaller.exe --onefile --windowed --icon="Path_of_.ico_file" app.py

For example:

If the app.py file is present in the current directory and app.ico is present inside the Images folder within the current directory.

Then the command should be as below. The final executable file will be generated inside the dist folder

pyinstaller.exe --onefile --windowed --icon=Images\app.ico app.py

I had similar problem. If no errors from pyinstaller try to change name of .exe file. It works for me