"OSError: File path\kivymd\fonts/Roboto-Regular.ttfs not found" error for kivyMD after compiling

635 views
Skip to first unread message

Ronald Saunfe

unread,
May 30, 2018, 12:05:03 PM5/30/18
to Kivy users support

after compiling my .py file and run the .exe i get the following error OSError: File myfilepath\kivymd\fonts/Roboto-Regular.ttfs not found for kivyMD in the command line i dont know how to fix it, and i dont know how to include it in the .spec file any suggestion i will appreciate. here is the full error

C:\Systems\Library management system\EXECUTABLE\dist\Library System>library.exe
[INFO   ] [Logger      ] Record log in C:\Users\Sycopath\.kivy\logs\kivy_18-05-2
9_61.txt
[INFO   ] [Kivy        ] v1.10.0
[INFO   ] [Python      ] v3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:16:59) [MS
C v.1900 32 bit (Intel)]
[INFO   ] [Factory     ] 194 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif
 (img_ffpyplayer ignored)
[INFO   ] [KivyMD      ] KivyMD version: 0.1.2
[INFO   ] [Text        ] Provider: sdl2
[INFO   ] [OSC         ] using <thread> for socket
[INFO   ] [Window      ] Provider: sdl2
[INFO   ] [GL          ] Using the "OpenGL" graphics system
[INFO   ] [GL          ] GLEW initialization succeeded
[INFO   ] [GL          ] Backend used <glew>
[INFO   ] [GL          ] OpenGL version <b'2.1.0 - Build 8.15.10.2189'>
[INFO   ] [GL          ] OpenGL vendor <b'Intel'>
[INFO   ] [GL          ] OpenGL renderer <b'Intel(R) HD Graphics'>
[INFO   ] [GL          ] OpenGL parsed version: 2, 1
[INFO   ] [GL          ] Shading version <b'1.20  - Intel Build 8.15.10.2189'>
[INFO   ] [GL          ] Texture max size <4096>
[INFO   ] [GL          ] Texture max units <16>
[INFO   ] [Shader      ] fragment shader: <b'No errors.'>
[INFO   ] [Shader      ] vertex shader: <b'No errors.'>
[INFO   ] [Shader      ] program: <No errors.>
[WARNING] [Image       ] Unable to load image <C:\Systems\Library management sys
tem\EXECUTABLE\dist\Library System\kivy_install\data\glsl\default.png>
[CRITICAL] [Window      ] Unable to find any valuable Window provider.
sdl2 - Exception: SDL2: Unable to load image
  File "site-packages\kivy\core\__init__.py", line 67, in core_select_lib
  File "site-packages\kivy\core\window\window_sdl2.py", line 140, in __init__
  File "site-packages\kivy\core\window\__init__.py", line 899, in __init__
  File "site-packages\kivy\core\window\window_sdl2.py", line 291, in create_wind
ow
  File "site-packages\kivy\core\window\__init__.py", line 1051, in create_window

  File "kivy\graphics\instructions.pyx", line 758, in kivy.graphics.instructions
.RenderContext.__init__ (kivy\graphics\instructions.c:12580)
  File "site-packages\kivy\core\image\__init__.py", line 538, in __init__
  File "site-packages\kivy\core\image\__init__.py", line 734, in _set_filename
  File "site-packages\kivy\core\image\__init__.py", line 435, in load
  File "site-packages\kivy\core\image\__init__.py", line 201, in __init__
  File "site-packages\kivy\core\image\img_sdl2.py", line 41, in load

[CRITICAL] [App         ] Unable to get a Window, abort.
 Exception ignored in: 'kivy.properties.dpi2px'
 Traceback (most recent call last):
   File "site-packages\kivy\utils.py", line 496, in __get__
   File "site-packages\kivy\metrics.py", line 174, in dpi
   File "site-packages\kivy\base.py", line 127, in ensure_window
 SystemExit: 1
[CRITICAL] [App         ] Unable to get a Window, abort.
 Exception ignored in: 'kivy.properties.dpi2px'
 Traceback (most recent call last):
   File "site-packages\kivy\utils.py", line 496, in __get__
   File "site-packages\kivy\metrics.py", line 174, in dpi
   File "site-packages\kivy\base.py", line 127, in ensure_window
 SystemExit: 1
[CRITICAL] [App         ] Unable to get a Window, abort.
 Exception ignored in: 'kivy.properties.dpi2px'
 Traceback (most recent call last):
   File "site-packages\kivy\utils.py", line 496, in __get__
   File "site-packages\kivy\metrics.py", line 174, in dpi
   File "site-packages\kivy\base.py", line 127, in ensure_window
 SystemExit: 1
[CRITICAL] [App         ] Unable to get a Window, abort.
 Exception ignored in: 'kivy.properties.dpi2px'
 Traceback (most recent call last):
   File "site-packages\kivy\utils.py", line 496, in __get__
   File "site-packages\kivy\metrics.py", line 174, in dpi
   File "site-packages\kivy\base.py", line 127, in ensure_window
 SystemExit: 1
 Traceback (most recent call last):
   File "main.py", line 8, in <module>
   File "<frozen importlib._bootstrap>", line 969, in _find_and_load
   File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
   File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
   File "c:\users\sycopath\appdata\local\programs\python\python35-32\lib\site-pa
ckages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
     exec(bytecode, module.__dict__)
   File "site-packages\kivymd\theming.py", line 17, in <module>
   File "site-packages\kivy\core\text\__init__.py", line 248, in register
     # convert configuration like:
 OSError: File C:\Systems\Library management system\EXECUTABLE\dist\Library Syst
em\kivymd\fonts/Roboto-Regular.ttfs not found
[6076] Failed to execute script main

ZenCODE

unread,
Jun 1, 2018, 4:45:43 PM6/1/18
to Kivy users support
If you build the app so it just displays a label with text, does that work? We should try to establish whether kivy is broken or kivymd. It is only breaks with kivymd, then you know where to look.

Ronald Saunfe

unread,
Jun 3, 2018, 4:03:09 PM6/3/18
to Kivy users support
 
Yes i tried compiling a simple application and found the same error. I figured out the problem was with KivyMD. the module  'material_resources.py' was the one with the error in the kivyMD modules.
here is where the error is

FONTS = [ { "name": "Roboto", "fn_regular": fonts_path + 'Roboto-Regular.ttf', "fn_bold": fonts_path + 'Roboto-Medium.ttf', "fn_italic": fonts_path + 'Roboto-Italic.ttf', "fn_bolditalic": fonts_path + 'Roboto-MediumItalic.ttf' }, { "name": "RobotoLight", "fn_regular": fonts_path + 'Roboto-Thin.ttf', "fn_bold": fonts_path + 'Roboto-Light.ttf', "fn_italic": fonts_path + 'Roboto-ThinItalic.ttf', "fn_bolditalic": fonts_path + 'Roboto-LightItalic.ttf' }, { "name": "Icons", "fn_regular": fonts_path + 'materialdesignicons-webfont.ttf' } ]
Reply all
Reply to author
Forward
0 new messages