2

I have created an app with kivy (using a .kv) which I would like to package into one single .exe file.

Using PyInstaller you can add the option --onefile but this does not work when you package using the spec file.

This is my spec file:

# -*- mode: python -*-

from kivy.deps import sdl2, glew

block_cipher = None


a = Analysis(['main.py'],
             pathex=['path\\myapp'],
             binaries=None,
             datas=None,
             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='myapp',
          debug=False,
          strip=False,
          upx=True,
          console=False )

coll = COLLECT(exe, Tree('path\\myapp\\'),
               a.binaries,
               a.zipfiles,
               a.datas,
               *[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],
               strip=False,
               upx=True,
               name='myapp')

I just want to have a single executable output that I can easily share.

Thanks for your help

FredericFox
  • 105
  • 1
  • 8
  • Possible duplicate of [Kivy: compiling to a single executable](http://stackoverflow.com/questions/35952595/kivy-compiling-to-a-single-executable) – Peter Badida Jan 03 '17 at 17:36

1 Answers1

3

Found it and worked !! For anyone who tries to achieve the same please refer to the post from RAJ:

Kivy: compiling to a single executable

Community
  • 1
  • 1
FredericFox
  • 105
  • 1
  • 8