1

I have been trying to package a Kivy app which runs perfectly from the .py file. I use the PyInstaller module to create the .exe file. The .exe file is created but it fails to open. I have tried all I can, and I have gone through the Kivy documentation https://kivy.org/docs/guide/packaging-windows.html# .

I noticed that the .exe file worked when it is only kivy modules that are imported but wouldn't work when other libraries such as pandas are imported.

Any help would be appreciated.

from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from tkinter.filedialog import askopenfilename
from kivy.lang import Builder
from kivy.uix.label import Label
from kivy.config import Config
import pandas as pd
import sqlite3
from kivy.properties import StringProperty
Config.set('graphics', 'resizable', '0')
Config.set('graphics', 'width', '800')
Config.set('graphics', 'height', '450')


def databasesetup(sharepoint,exchange,onedrivefaculty,onedrivestudent):

def sharepoint(filename):

def exchangecleanup(file):

def OD4Bclean(filename):

class Container(BoxLayout):
    Message = StringProperty()
    def Selectfile(self):

    def Selectfilecsv(self):

    def Cleandata(self):
    """ This function cleans all the uploaded files and returns the cleaned dataframes  """

    def CreateDatabase(self):


    def downloadfiles(self):


class MainApp(App):
    def build(self):
        self.title = 'Technology Support App for Office 365 adoption'
        return Container()

if __name__ == "__main__":
    app = MainApp()
    app.run()

the .spec file

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

block_cipher = None


a = Analysis(['main.py'],
         pathex=['D:\\Users\\bodea\\Documents\\desktop kivy app\\main'],
         binaries=[],
         datas=[],
         hiddenimports=[],
         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='main',
      debug=False,
      strip=False,
      upx=True,
      console=True )
coll = COLLECT(exe,Tree('D:\\Users\\bodea\\Documents\\desktop kivy app\\main'),
           a.binaries,
           a.zipfiles,
           a.datas,*[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],
           strip=False,
           upx=True,
           name='main')
  • Try running the .exe from a command prompt window to see any error messages. Also consider adding the `verbose` flag to the python interpreter when the .exe is run. See [When Things Go Wrong](https://pyinstaller.readthedocs.io/en/v3.3.1/when-things-go-wrong.html). – John Anderson May 02 '18 at 15:29

0 Answers0