Pyinstaller does not understand kv, and so does not see the kv import statements.
You can add the import statements to the hidden imports section of your spec file or in your main python file import those modules.
I prefer to do the imports in the main python module, and have a spec file I can generally reuse with minimal customization.
Pycharm will let you know that the imported modules are not being used, just ignore that.
Here is the spec file I use for creating apps. I create a directory at the same level as the source code under a project, call ProjectDist. I mention this because I use relative paths to identify files.
This will build a ‘one folder bundle’ I package the exe and the directory using https://jrsoftware.org/isinfo.php This creates a professional looking installer that also generates an uninstaller in Windows.
# -*- mode: python -*-
import os
from kivy_deps import sdl2, glew
spec_root = os.path.abspath(SPECPATH)
block_cipher = None
app_name = 'Your App Name'
win_icon = '../Images/your_icon.ico'
a = Analysis(['../main.py'],
pathex=[spec_root],
binaries=[],
datas=[('../*.kv', '.'), # Change these to match your project
('../Images/*.png', './Images')],
hiddenimports=['win32timezone'],
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=app_name,
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=False,
console=False,
icon=win_icon)
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
*[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],
strip=False,
upx=False,
name=app_name)
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/d07242ff-c5c9-4589-90ea-a194b15d945fn%40googlegroups.com.