Create a SPEC file from the py file with pyinstaller (this time the py file is main.py and the kv file is test.ky).
pyinstaller main.py
When executed, a file called main.spec will be created in the working directory. I will modify this SPEC file this time.
Open the file and first insert the following statement on the first line:
from kivy.deps import sdl2, glew
Then, add Tree ('.'), * [Tree (p) for p in (sdl2.dep_bins + glew.dep_bins)] </ font> as follows. , Modify name to kv filename.
coll = COLLECT(exe,Tree('.'),
a.binaries,
a.zipfiles,
a.datas,
*[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],
strip=False,
upx=True,
name='test')
Then again with pyinstaller, this time create an exe file using the SPEC file.
pyinstaller main.spec
Then, a folder called test is created in a folder called dist, and the exe file is contained in it.
Recommended Posts