fatal error in windows application

35 views
Skip to first unread message

Gaurav Bhoi

unread,
Feb 26, 2021, 10:53:18 AM2/26/21
to Kivy users support
Hello Guys, I have created a windows application using auto-py-to-exe. But i m getting error after running application. What shall I do help

Elliot Garbus

unread,
Feb 26, 2021, 4:55:56 PM2/26/21
to kivy-...@googlegroups.com
What is the error?
Are there any error messages in the kivy log?

I regularly build apps for Windows and Mac using pyinstaller. I have not used auto-py-to-exe. 

Sent from my iPad

On Feb 26, 2021, at 8:53 AM, Gaurav Bhoi <bhoiga...@gmail.com> wrote:


Hello Guys, I have created a windows application using auto-py-to-exe. But i m getting error after running application. What shall I do help

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/ada42709-4877-4225-9bdd-60d5589cab41o%40googlegroups.com.

Gaurav Bhoi

unread,
Feb 27, 2021, 8:17:17 AM2/27/21
to kivy-...@googlegroups.com
I don't know how to use pyinstaller. kivy's official document is confusing me. I also want to know how to include kv, app icon,  images and various files in app.  please guide me. Thank you in advance

You received this message because you are subscribed to a topic in the Google Groups "Kivy users support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kivy-users/zp5L6vudNF8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/F78CFC4C-A5D6-400A-8A5F-444769EC80B0%40cox.net.

Gaurav Bhoi

unread,
Feb 27, 2021, 8:18:09 AM2/27/21
to kivy-...@googlegroups.com
Tell me whole process please

Elliot Garbus

unread,
Feb 27, 2021, 9:22:38 AM2/27/21
to kivy-...@googlegroups.com

Here is a video that gives you an overview of how Pyinstaller works.  I found it helpful.  https://youtu.be/tOTLqUQC-k0

 

Here are directions and a spec file (below) I use.

I will assume you have a project directory that includes your .py files.  Create a sub directory and put the spec file in it.  I call it W10.spec.

On the console switch the to same directory the spec file is located in:

>pyinstaller -spec W10.spec

 

This will build a multi-file bundle.  I then use the Inno Soft setup compiler to build a windows installer.  Use the wizard, it is easy.

https://jrsoftware.org/isinfo.php

 

In the spefile  you will need to edit the highlighted lines.  Provide the app_name, and the windows icon.  The datas section is a list of tuples that specify the source files and destination directory of other files you want in your bundle.   See: https://pyinstaller.readthedocs.io/en/stable/spec-files.html#adding-data-files

 

If your executable does not run, look in the kivy log file and read the traceback.  You may have missing imports.  If there are libraries or library dependencies that are missing I add them as imports in the python code to minimize edits to the specfile.

 

 

# -*- mode: python -*-


import os
from kivy_deps import sdl2, glew

spec_root = os.path.abspath(SPECPATH)
block_cipher =
None
app_name = 'Your App Name Here'
win_icon = '../Images/YourIconHEre.ico'

a = Analysis(['../main.py'],
            
pathex=[spec_root],
            
datas=[('../*.kv', '.'),
                    (
'../Images/*.png', './Images')],
            
hiddenimports=['win32timezone'],
            
hookspath=[],
            
runtime_hooks=[],
            
excludes=[],
            
win_no_prefer_redirects=False,
            
win_private_assemblies=False,
            
cipher=block_cipher,
            
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
            
cipher=block_cipher)
exe = EXE(pyz,
          a.scripts,
          [],
          
exclude_binaries=True,
         
name=app_name,
         
debug=False,
         
bootloader_ignore_signals=False,
         
strip=False,
         
upx=False,
         
console=False,
         
icon=win_icon)
coll = COLLECT(exe,
               a.binaries,
               a.zipfiles,
               a.datas,
               *[Tree(p)
for p in (sdl2.dep_bins + glew.dep_bins)],
              
strip=False,
              
upx=False,
              
name=app_name)

Gaurav Bhoi

unread,
Feb 28, 2021, 11:34:39 AM2/28/21
to kivy-...@googlegroups.com
Hello Elliot, Thank you for all your help and support. I m still making some mistake in compiling the app. I m pretty sure there is a some mistake in spec file i have pasted below. please help thank you.

spec file : 

from kivy_deps import sdl2, glew
# -*- mode: python ; coding: utf-8 -*-

block_cipher = None
app_name = 'first test app'

a = Analysis(['testing.py'],
             pathex=['C:\\Users\\NexGen\\Desktop\\test for compiling'],
             binaries=[],
             datas=[('testing.kv', '.'),
   ('/Data/Document.txt', '.')
   ('/Data/icon.jpg', '.')
   ('/Data/testbg.jpg', '.')],
             hiddenimports=[],

             hookspath=[],
             runtime_hooks=[],
             excludes=[],
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher,
             noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
             cipher=block_cipher)
exe = EXE(pyz,
          a.scripts,
          [],
          exclude_binaries=True,
          name='testing',
          debug=False,
          bootloader_ignore_signals=False,
          strip=False,
          upx=True,
          console=False )

coll = COLLECT(exe,
               a.binaries,
               a.zipfiles,
               a.datas,
      *[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],
               strip=False,
               upx=True,
               upx_exclude=[],
               name='testing')

Elliot Garbus

unread,
Feb 28, 2021, 12:49:53 PM2/28/21
to kivy-...@googlegroups.com

I’d assume you want your data to be in a Data subdirectory… You can look in the created dist directory and look where your files are located.

 

datas=[('testing.kv', '.'),

              ('/Data/Document.txt', './Data')
              ('/Data/icon.jpg', './Data')
              ('/Data/testbg.jpg', './Data')],

you could make things simpler and use a wildcard.

datas=[('testing.kv', '.'),

             ('/Data/*.*', './Data')],

Reply all
Reply to author
Forward
0 new messages