Упаковка приложения Kivy 1.9.10 для Windows - PullRequest
0 голосов
/ 29 апреля 2018

Я пытался упаковать приложение Kivy, которое отлично работает из файла .py. Я использую модуль PyInstaller для создания файла .exe. Файл .exe создан, но не открывается. Я перепробовал все, что мог, и я просмотрел документацию Kivy https://kivy.org/docs/guide/packaging-windows.html#.

Я заметил, что файл .exe работает, когда импортируются только модули kivy, но не работает, когда импортируются другие библиотеки, такие как pandas.

Любая помощь будет оценена.

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()

.spec файл

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')
...