1

I am trying to create a console based exe using pyinstaller using the following command.

pyinstaller --onefile --console -i icon/app.ico main.py

or

pyinstaller --onefile --console --icon=./icon/app.ico main.py

Pyinstaller creates the exe but it does not embed the icon which I have provided. My icon file name is app.ico and is located inside a folder called icon. Please help about how to do it.

Sambit
  • 7,625
  • 7
  • 34
  • 65
  • Are you familiar with [Using Data Files from a Module](https://pyinstaller.readthedocs.io/en/stable/spec-files.html#using-data-files-from-a-module) – stovfl Apr 27 '19 at 20:32

1 Answers1

1

Actually, it works, I mean this command pyinstaller --onefile --console -i icon/app.ico main.py works. There is a problem with icon cache, that is why it was not properly reflecting. Once exe is created, copy the exe file to a different location, it works and you can see the icon in the exe.

Sambit
  • 7,625
  • 7
  • 34
  • 65