Sambit
Sambit

Reputation: 8001

How to provide relative path of icon in PyInstaller while creating an exe

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.

Upvotes: 1

Views: 759

Answers (1)

Sambit
Sambit

Reputation: 8001

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.

Upvotes: 1

Related Questions