When i try to use pyinstaller with 'KivyMD Kitchen Sink' (--one file --debug --clean) i get this:
File "kivymd\theming.py", line 17, in <module>
File "site-packages\kivy\core\text\__init__.py", line 248, in register
# and pass it in context.config token
OSError: File C:\Users\username\AppData\Local\Temp\_MEI92522\kivymd\fonts/Roboto-Regular.ttfs not found
Failed to execute script main
I try to use:
if hasattr(sys, '_MEIPASS'):
os.chdir(sys._MEIPASS)
in main.py but nothing changed.
Also, i copied Roboto-Regular.ttf to the main.exe's directory without success.
Pyinstaller is working well with other Kivy apps.
UPDATE:
I found a temporaly solution. I used pyinstaller's --onedir
command with main.py instead main.spec file:
wine pyinstaller --onedir main.py
Then, i copied kivymd folder (../site-packages/kivyMD) to my app's folder, and the app started without errors.
Anyways, I would like freeze app as a --onefile
, Any suggesions? thanks!