I suggest sticking with PyInstaller. Go with a one directory build. Given the number of files in a kivy project, it will not build into one file. It will be a multifie output even if a single file is requested.
Follow the directions to the letter for doing a build as in the kivy packaging directions. Create a separate directory as specified. It will be easier to help you if you share your .spec file.
Here is the code where I pull in my icon and KV file, this is under build(), and requires import sys, os (at the top of the file.
|
| if getattr(sys, 'frozen', False): # required so data files can be packed by pyinstaller |
| application_path = sys._MEIPASS |
| else: |
| application_path = os.path.dirname(__file__) |
| iconfile = os.path.join(application_path, 'SY300logo64.png') |
| kvfile = os.path.join(application_path, 'osc_panel.kv') |
|
|
| self.icon = iconfile |
| r = Builder.load_file(kvfile) |
This lets lets the program know where these data files are when it is 'frozen'. I'm not completely certain this is required, but i have done this in a recent kivy project and it worked fine. This is described in the PyInstaller documentation.
Here is the PyInstaller specfile for my project:
# -*- mode: python -*-
from kivy.deps import sdl2, glew
block_cipher = None
a = Analysis(['..\\main.py'],
pathex=['C:\\Users\\Elliot and Sharon\\PycharmProjects\\sand_box\\try'],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
[],
exclude_binaries=True,
name='try',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True )
coll = COLLECT(exe, Tree('C:\\Users\\Elliot and Sharon\\PycharmProjects\\sand_box\\'),
a.binaries,
a.zipfiles,
a.datas,
*[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],
strip=False,
upx=True,
name='try')