Raspberry Pi - Pyinstaller can't find window

46 views
Skip to first unread message

Michael Lynn

unread,
Jun 6, 2019, 9:19:33 AM6/6/19
to Kivy users support
I have gotten kivy to run my application on the raspberry pi from the command line using 'KIVY_GL_BACKEND=gl'. When I package up my application it finds a valid window and then attempts to find an additional window but I only use one. Below I have attached the functional output when running the python script from the command line and the failed output when running from pyinstaller output.

Here is a snapshot of the output when running from with the python3 command line:
[INFO   ] [Logger      ] Record log in /root/.kivy/logs/kivy_19-06-06_24.txt
[DEBUG  ] [Cache       ] register <kv.image> with limit=None, timeout=60
[DEBUG  ] [Cache       ] register <kv.atlas> with limit=None, timeout=None
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_pil, img_gif (img_sdl2, img_ffpyplayer ignored)
[DEBUG  ] [Cache       ] register <kv.texture> with limit=1000, timeout=60
[DEBUG  ] [Cache       ] register <kv.shader> with limit=1000, timeout=3600
[INFO   ] [Kivy        ] v2.0.0.dev0, git-c4b8743, 20190603
[INFO   ] [Kivy        ] Installed at "/usr/local/lib/python3.5/dist-packages/kivy/__init__.py"
[INFO   ] [Python      ] v3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516]
[INFO   ] [Python      ] Interpreter at "/usr/bin/python3"
[INFO   ] [Factory     ] 184 symbols loaded
[DEBUG  ] [Cache       ] register <kv.lang> with limit=None, timeout=None
[INFO   ] [Window      ] Provider: egl_rpi
[DEBUG  ] [Window      ] Actual display size: 1024x768
[INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system
[DEBUG  ] [GL          ] glShaderBinary is not available
[INFO   ] [GL          ] Backend used <gl>
[INFO   ] [GL          ] OpenGL version <b'OpenGL ES 2.0'>
[INFO   ] [GL          ] OpenGL vendor <b'Broadcom'>
[INFO   ] [GL          ] OpenGL renderer <b'VideoCore IV HW'>
[INFO   ] [GL          ] OpenGL parsed version: 2, 0
[INFO   ] [GL          ] Shading version <b'OpenGL ES GLSL ES 1.00'>
[INFO   ] [GL          ] Texture max size <2048>
[INFO   ] [GL          ] Texture max units <8>

Here is the output when running the output of the program generated from pyinstaller.
[INFO   ] [Logger      ] Record log in /root/.kivy/logs/kivy_19-06-06_32.txt
[DEBUG  ] [Cache       ] register <kv.image> with limit=None, timeout=60
[DEBUG  ] [Cache       ] register <kv.atlas> with limit=None, timeout=None
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_gif (img_sdl2, img_pil, img_ffpyplayer ignored)
[DEBUG  ] [Cache       ] register <kv.texture> with limit=1000, timeout=60
[DEBUG  ] [Cache       ] register <kv.shader> with limit=1000, timeout=3600
[INFO   ] [Kivy        ] v2.0.0.dev0, git-c4b8743, 20190603
[INFO   ] [Kivy        ] Installed at "/usr/local/lib/python3.5/dist-packages/kivy/__init__.py"
[INFO   ] [Python      ] v3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516]
[INFO   ] [Python      ] Interpreter at "/home/pi/git/rpi_inventory_management_software/fulfillment/build/dist/Fulfillment/Fulfillment"
[INFO   ] [Logger      ] Purge log fired. Analysing...
[INFO   ] [Logger      ] Purge 19 log files
[INFO   ] [Logger      ] Purge finished!
[INFO   ] [Factory     ] 184 symbols loaded
[DEBUG  ] [Cache       ] register <kv.lang> with limit=None, timeout=None
[INFO   ] [Window      ] Provider: egl_rpi
[DEBUG  ] [Window      ] Actual display size: 1024x768
[INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system
[INFO   ] [Window      ] Provider: sdl2(['window_egl_rpi'] ignored)
error
: XDG_RUNTIME_DIR not set in the environment.
[DEBUG  ] [Window      ] Ignored <x11> (import error)
[CRITICAL] [Window      ] Unable to find any valuable Window provider. Please enable debug logging (e.g. add -d if running from the command line, or change the log level in the config) and re-run your app to identify potential causes
egl_rpi
- NameError: name '_imp' is not defined
 
File "/usr/local/lib/python3.5/dist-packages/kivy/core/__init__.py", line 70, in core_select_lib
    cls
= cls()
 
File "/usr/local/lib/python3.5/dist-packages/kivy/core/window/__init__.py", line 969, in __init__
   
self.create_window()
 
File "/usr/local/lib/python3.5/dist-packages/kivy/core/window/window_egl_rpi.py", line 39, in create_window
   
super(WindowEglRpi, self).create_window()
 
File "/usr/local/lib/python3.5/dist-packages/kivy/core/window/__init__.py", line 1230, in create_window
    init_gl
()
 
File "/usr/local/lib/python3.5/dist-packages/kivy/core/gl/__init__.py", line 38, in init_gl
    gl_init_symbols
()
 
File "kivy/graphics/opengl.pyx", line 1556, in kivy.graphics.opengl.gl_init_symbols
 
File "kivy/graphics/cgl.pyx", line 90, in kivy.graphics.cgl.cgl_init
 
File "importlib/__init__.py", line 126, in import_module
   
return _bootstrap._gcd_import(name[level:], package, level)
 
File "importlib/_bootstrap.py", line 984, in _gcd_import
    _imp
.acquire_lock()

sdl2
- RuntimeError: b'No available video device'
 
File "/usr/local/lib/python3.5/dist-packages/kivy/core/__init__.py", line 70, in core_select_lib
    cls
= cls()
 
File "/usr/local/lib/python3.5/dist-packages/kivy/core/window/window_sdl2.py", line 152, in __init__
   
super(WindowSDL, self).__init__()
 
File "/usr/local/lib/python3.5/dist-packages/kivy/core/window/__init__.py", line 969, in __init__
   
self.create_window()
 
File "/usr/local/lib/python3.5/dist-packages/kivy/core/window/window_sdl2.py", line 289, in create_window
   
self.fullscreen, resizable, state)
 
File "kivy/core/window/_window_sdl2.pyx", line 111, in kivy.core.window._window_sdl2._WindowSDL2Storage.setup_window
 
File "kivy/core/window/_window_sdl2.pyx", line 75, in kivy.core.window._window_sdl2._WindowSDL2Storage.die

x11
- ImportError: No module named 'kivy.core.window.window_x11'
 
File "/usr/local/lib/python3.5/dist-packages/kivy/core/__init__.py", line 62, in core_select_lib
    fromlist
=[modulename], level=0)

[INFO   ] [Text        ] Provider: sdl2
[DEBUG  ] [Cache       ] register <textinput.label> with limit=None, timeout=60.0
[DEBUG  ] [Cache       ] register <textinput.width> with limit=None, timeout=60.0
[DEBUG  ] [App         ] Loading kv </home/pi/git/rpi_inventory_management_software/fulfillment/build/dist/Fulfillment/fulfillment/fulfillmentui.kv>
[DEBUG  ] [App         ] kv </home/pi/git/rpi_inventory_management_software/fulfillment/build/dist/Fulfillment/fulfillment/fulfillmentui.kv> not found
 
Traceback (most recent call last):
   
File "rpi_inventory_management_software/fulfillment/fulfillment_management.py", line 150, in <module>
     fulfillment_ui
.FulfillmentUI().run()
   
File "/usr/local/lib/python3.5/dist-packages/kivy/app.py", line 829, in run
     root
= self.build()
   
File "/home/pi/git/rpi_inventory_management_software/fulfillment/build/dist/Fulfillment/fulfillment/fulfillment_ui.py", line 28, in build
     
with kivy.core.window.Window.canvas:
 
AttributeError: 'NoneType' object has no attribute 'canvas'
[20591] Failed to execute script fulfillment_management

Any Ideas on how to resolve this issue?

Thanks Michael
Reply all
Reply to author
Forward
0 new messages