python - Pyinstaller - .ico file still not included from .spec (--onefile) -


i trying use pyinstaller make .exe python program. altered datas .spec file include program's .ico file, still says missing .ico on execution.

the spec file (raven.py program , raven.ico .ico file needs):

# -*- mode: python -*-  block_cipher = none   = analysis(['c:\\users\\andrew\\desktop\\project\\raven.py'],          pathex=['c:\\users\\andrew'],          binaries=none,          datas=[ ('c:\\users\\andrew\\desktop\\project\\raven.ico', '.') ],          hiddenimports=[],          hookspath=[],          runtime_hooks=[],          excludes=[],          win_no_prefer_redirects=false,          win_private_assemblies=false,          cipher=block_cipher) pyz = pyz(a.pure, a.zipped_data,          cipher=block_cipher) exe = exe(pyz,          a.scripts,          a.binaries,          a.zipfiles,          a.datas,          name='raven',          debug=false,          strip=false,          upx=true,          console=true ) 

this typing command prompt pyinstaller:

pyinstaller --onefile c:\users\andrew\raven.spec 

then acts working , creates .exe file, says missing raven.ico , terminates.

adding .ico file same directory .exe makes program work fine.

also, if matters, using tkinter , raven.py imports 2 other python files of mine.

you should add option icon in spec. if want add

'c:\users\andrew\desktop\project\raven.ico'

you should use

# -*- mode: python -*-  block_cipher = none   = analysis(['c:\\users\\andrew\\desktop\\project\\raven.py'],      pathex=['c:\\users\\andrew'],      binaries=none,      datas=[ ('c:\\users\\andrew\\desktop\\project\\raven.ico', '.') ],      hiddenimports=[],      hookspath=[],      runtime_hooks=[],      excludes=[],      win_no_prefer_redirects=false,      win_private_assemblies=false,      cipher=block_cipher) pyz = pyz(a.pure, a.zipped_data,      cipher=block_cipher) exe = exe(pyz,      a.scripts,      a.binaries,      a.zipfiles,      a.datas,      name='raven',      debug=false,      strip=false,      upx=true,      console=true , icon='c:\\users\\andrew\\desktop\\project\\raven.ico') 

Comments