Nemo February 2016

pyinstaller exe blank screen (Kivy)

I've built a .exe on Windows 10 using PyInstaller. When I run the executable, a window opens but it doesn't display any widgets, only a blank screen. Output doesn't show any errors, as far as I can make out. Using python 2.7 (Enthought Canopy) with Kivy 1.9.1. When I run the original source file, everything works perfectly; it's only the .exe that fails.

My .spec file looks like this:

# -*- mode: python -*-
from kivy.deps import sdl2, glew, gstreamer

block_cipher = None

a = Analysis(['C:\\Users\\Christiaan\\Documents\\lifeq_dp_pp_p\\toolbox\\ui\\data_importer\\PhoenixKv.py'],
         pathex=['C:\\Users\\Christiaan\\Documents\\Phoenix'],
         binaries=None,
         datas=[('C:\\Users\\Christiaan\\Documents\\lifeq_dp_pp_p\\toolbox\\ui\\data_importer\\dev_ids.json', '.'), ('C:\\Users\\Christiaan\\Documents\\lifeq_dp_pp_p\\toolbox\\ui\\data_importer\\ref_ids.json', '.')],
         hiddenimports=['sqlalchemy.ext.hybrid'],
         hookspath=[],
         runtime_hooks=[],
         excludes=[],
         win_no_prefer_redirects=False,
         win_private_assemblies=False,
         cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
         cipher=block_cipher)
exe = EXE(pyz,
      a.scripts,
      exclude_binaries=True,
      name='phoenix',
      debug=True,
      strip=False,
      upx=False,
      console=True )
coll = COLLECT(exe, Tree('C:\\Users\\Christiaan\\Documents\\lifeq_dp_pp_p'),
           a.binaries,
           a.zipfiles,
           a.datas + [('dev_ids.json', 'C:\\Users\\Christiaan\\Documents\\lifeq_dp_pp_p\\toolbox\\ui\\data_importer\\', 'DATA'), ('ref_ids.json', 'C:\\Users\\Christiaan\\Documents\\lifeq_dp_pp_p\\toolbox\\ui\\data_importer\\', 'DATA')],
           *[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],
           strip=False,
           upx=False,
           name='phoenix')

and my output when running is:

PyInstaller Bootloader 3.x
LOADER: executable is         C:\Users\Chri        

Answers


bw4sz March 2016

I had this same problem and solved it by copying the .kv file to the dist folder.

cp -R C:/Users/Ben/Documents/OpenCV_HummingbirdsMotion/MotionMeerkat/MotionMeerkat.kv dist/main/

This may also be achieved by adding the .kv to the spec file as a data object. Basically the blank screen says, i know there is a kivy app, but i have no widgets.

Post Status

Asked in February 2016
Viewed 1,688 times
Voted 11
Answered 1 times

Search




Leave an answer