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.
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.
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)
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/CAH_LR1We9BXh%2Bx0AAkE92RqspAdo%2BJX2RHgym-YERVp6%2BwVc%3DQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/603a55aa.1c69fb81.c45ba.3277SMTPIN_ADDED_MISSING%40gmr-mx.google.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')],
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/CAH_LR1UYbEDEPqt9T9vSr3QEqE733%2BLZN8Pcha%3DLmPt3T4f2aQ%40mail.gmail.com.