import kivy
from kivy.app import Appfrom kivy.uix.button import Button
class MyApp(App): def build(self): return Button(text='Hello world') if __name__ == '__main__': MyApp().run()python -m PyInstaller --name hello ..\hello\hello.py
# -*- mode: python -*-
from kivy.deps import sdl2, glew
block_cipher = None
a = Analysis(['..\\hello\\hello.py'], pathex=['E:\\projects\\kivy\\app'], 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, exclude_binaries=True, name='hello', debug=False, strip=False, upx=True, console=True )coll = COLLECT(exe,Tree('..\\hello\\'), a.binaries, a.zipfiles, a.datas, *[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)], strip=False, upx=True, name='hello')
python -m PyInstaller hello.spec
115891 INFO: Warnings written to E:\projects\kivy\app\build\hello\warnhello.txt116418 INFO: checking PYZ116466 INFO: checking PKG116466 INFO: Building because E:\projects\kivy\app\build\hello\hello.exe.manifest changed116466 INFO: Building PKG (CArchive) out00-PKG.pkg116668 INFO: Bootloader C:\Python27\lib\site-packages\PyInstaller\bootloader\Windows-64bit\run.exe116668 INFO: checking EXE116668 INFO: Rebuilding out00-EXE.toc because pkg is more recent116684 INFO: Building EXE from out00-EXE.toc116684 INFO: Appending archive to EXE E:\projects\kivy\app\build\hello\hello.exe116793 INFO: checking Tree116793 INFO: Building Tree because out02-Tree.toc is non existent116793 INFO: Building Tree out02-Tree.toc116793 INFO: checking Tree116793 INFO: Building Tree because out03-Tree.toc is non existent116809 INFO: Building Tree out03-Tree.toc116841 INFO: checking Tree116841 INFO: Building Tree because out04-Tree.toc is non existent116841 INFO: Building Tree out04-Tree.toc116871 INFO: checking COLLECTWARNING: The output directory "E:\projects\kivy\app\dist\hello" and ALL ITS CONTENTS will be REMOVED! Continue? (y/n)y121427 INFO: Removing dir E:\projects\kivy\app\dist\hello121677 INFO: Building COLLECT out00-COLLECT.toc121740 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 9177)
E:\projects\kivy\app>The binary wheels are not built for python 3.8, use python 3.7
Assuming you are using kivy 1.11.1
You need to import:
from kivy_deps import sdl2, glew
NOT: kivy.deps
Below is the spec file I use to build Windows10 programs. It is worth recognizing that the spec file is python code, you can add print statements to help figure out what is going on. Change the highlighted areas below to customize for your program.
Here is the best video on Pyinstaller I have found to date: https://youtu.be/tOTLqUQC-k0
# -*- mode: python -*-
import os
from kivy_deps import sdl2, glew
spec_root = os.path.abspath(SPECPATH)
block_cipher = None
app_name = 'Chase Bliss Editor'
win_icon = '../Images/cb_icon.ico'
a = Analysis(['../main.py'],
pathex=[spec_root],
datas=[('../*.kv', '.'), ('../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/5cc370a0-7262-4e0d-95b8-0f01a13818bc%40googlegroups.com.