Search code examples
pythonpyinstallerpyside6

How to include png files in pyinstaller packaging?


I'm making a PySdie6 web browser. There are buttons like back, forward, refresh etc. in my web browser.

When I package this using PyInstaller, (pyinstaller --onefile --windowed --name "Name" --icon "Path" browser.py) and run the .exe file, the icons are not visible in my final .exe file. How could I fix this?

Since this is a project I'm eager to distribute, I'd like a method that preserves the files if I distribute the .exe file to a customer, say.


Solution

  • As a work around you can add it manually to the spec file if it's not there. See here as a reference.