Kivy PyInstaller, Unable to get a Window, abort.

1,234 views
Skip to first unread message

Aftab Sarwar

unread,
Feb 22, 2018, 10:51:49 AM2/22/18
to Kivy users support
Hello,
I'm trying to create an exe using PyInstaller. My Kivy app works just fine on my machine, the problem is faced when an exe is created and run.

1. I am following this guide to create package: https://kivy.org/docs/guide/packaging-windows.html

2. I have tried this solution, downloaded installer and tried to the above: https://stackoverflow.com/questions/40697876/kivy-unable-to-get-a-window-abort

3. Tried re-installed everything, including gstreamer (somebody suggested install gstreamer even if not used in app):
pip install --upgrade pip wheel setuptools
pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew
pip install kivy.deps.gstreamer
pip install kivy.deps.angle
pip install kivy


4. Tried everything that could be found online

Looking for help.


ERROR LOG:
============
Purge log fired. Analysing...
Purge 2 log files
Purge finished!
[INFO   ] [Logger      ] Record log in C:\Users\Universal\.kivy\logs\kivy_18-02-22_79.txt
[INFO   ] [Kivy        ] v1.10.0
[INFO   ] [Python      ] v3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 bit (AMD64)]
[INFO   ] [Factory     ] 194 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
[INFO   ] [OSC         ] using <thread> for socket
[INFO   ] [Window      ] Provider: sdl2
[INFO   ] [GL          ] Using the "OpenGL" graphics system
[INFO   ] [GL          ] Backend used <sdl2>
[INFO   ] [GL          ] OpenGL version <b'4.5.13397 Compatibility Profile Context 0'>
[INFO   ] [GL          ] OpenGL vendor <b'ATI Technologies Inc.'>
[INFO   ] [GL          ] OpenGL renderer <b'AMD Radeon R5 M335'>
[INFO   ] [GL          ] OpenGL parsed version: 4, 5
[INFO   ] [GL          ] Shading version <b'4.40'>
[INFO   ] [GL          ] Texture max size <16384>
[INFO   ] [GL          ] Texture max units <32>
[WARNING] [Image       ] Unable to load image <E:\COBRA_CRS_Redesign\crs\dist\main\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_window
  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.

Alexey Kononenko

unread,
Jun 27, 2018, 7:33:13 PM6/27/18
to Kivy users support
Excuse me. Did you solve it? I have the same issue

ZenCODE

unread,
Jun 28, 2018, 2:48:39 AM6/28/18
to Kivy users support
Please post your pyinstaller .spec file.

Alexey Kononenko

unread,
Jun 28, 2018, 2:55:38 AM6/28/18
to Kivy users support
I solved the issue by following documentation and making all the minor files like '.kv' + small written code into a different folder. 

"into spec"
from kivy.deps import sdl2, glew
block_cipher = None

coll = COLLECT(exe, Tree('min'),
               a.binaries,
               a.zipfiles,
               a.datas,
               strip=False,
               upx=True,
               *[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],
               name='main')
Reply all
Reply to author
Forward
0 new messages