pyinstaller icon indicating copy to clipboard operation
pyinstaller copied to clipboard

struct.error: unpack requires a bytes object of length 16 (same as issue #2051)

Open gtatyous opened this issue 9 years ago • 5 comments

First of all, thank you for making such an awesome tool! I have used pyinstaller to package my app in one file and it works perfectly. However....

I tried to add an icon to my exe through the spec file and it failed to do so. The exact err msg says: struct.error: unpack requires a bytes object of length 16 This is the same exact as issue #2051, which was closed without any answers!

Here's how my EXE object looks like in the spec file:

exe = EXE(pyz,
          a.scripts,
          a.binaries,
          a.zipfiles,
          a.datas,
          name='stuff',
          debug=False,
          strip=False,
          upx=True,
          console=True,
          icon="somefile.ico")

I have downloaded an icon from google and saved it as somefile.ico in Windows64 Any help is appreciated. Thank you!

gtatyous avatar Feb 08 '17 16:02 gtatyous

The icon is not a valid ico file. If you want a valid ico file, you can download one here.

ghost avatar Feb 08 '17 17:02 ghost

Yeah google images does not work as icons for some reason!

gtatyous avatar Feb 08 '17 17:02 gtatyous

Please close the issue if it is solved.

ghost avatar Feb 08 '17 23:02 ghost

@yagman: Of course icons for windows need to be the correct file/image format. When you "downloaded an icon from google and saved it as somefile.ico": Was this an .ico file? Did you convert it into an .ico file? Or did you just change the name?

htgoebel avatar Feb 09 '17 21:02 htgoebel

I downloaded a png file from google and changed its extension (name) to *.ico using the command line. That does not work for some reason so you'd have to convert your png into proper dumb windows ico format!

gtatyous avatar Feb 09 '17 21:02 gtatyous