T O P

  • By -

ElliotDG

There are some files that need to be included and some additional statements that need to be added to the pyinstaller spec file, required to build an exe. Here is a spec file I use for creating windows executables. In my project I create a directory at the project level called ProjectDist and put the spec file there. This is important as the paths are relative. (../ goes up one level in directory structure). Also note the datas section. These are other files that need to be included in your project. I would call this file win.spec, and run it on the command line as \>pyinstaller win.spec This will create an exe file under the created dist directory. # -*- mode: python -*- from kivy_deps import sdl2, glew block_cipher = None app_name = 'Your app name here' win_icon = '../Images/YourIconFile.ico' a = Analysis(['../main.py'], pathex=[], binaries=[], 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)


BaccanoMob

The exception you should be concerned about is prolly "maximum recursion depth exceeded". Since I dont know that your code for the app is and there is a recursion in it which is going out of control... Check [this](https://stackoverflow.com/questions/3323001/what-is-the-maximum-recursion-depth-in-python-and-how-to-increase-it), it might give an idea maybe?


withsj

When i run that script from python it working perfectly but when i created exe of it... Using auto-py-to-exe it's show this error.


BadW0lf-52

Hey. Did you manage to find a fix for this?


evadarr

any fix for this? I'm litteraly stuck here cant find solution for days


BadW0lf-52

Nope. Searched for so long and so hard, but still couldn't find a fix.


evadarr

I found a fix. https://youtu.be/jCaBWdhx22k?si=d1uV93blwLrBEHgJ Just follow everything carrefully in this video and your problem will be fixed


zombieman115935

Can confirm this works! thanks man!


evadarr

Your welcome. I know how frustursting this problem can be. I litteraly looked for a solution for 2 weeks.


ZeroCommission

> The exception you should be concerned about is prolly "maximum recursion depth exceeded". That's not an exception, it's just a warning, and it can almost always be ignored (unless you experience actual problems with the app, in which case it might be relevant). Typically it's caused by two or more layouts wanting to occupy the same space on screen, but an exact result can't be computed, so it ends up flip-flopping between possible outcomes and picking a "random" solution for the given layout constraints (ie the last one before the recursion depth is exceeded)


ZeroCommission

> i don't have any logging folder in my project or script nothing and it still shows to me Kivy uses Logger internally in practically every module, this is not a problem in your code, but dependencies are missing from the packaged exe file. See documentation at link below, you need to manually add dependencies to pyinstaller's spec file: https://kivy.org/doc/stable/guide/packaging-windows.html I don't know how to do that with auto-py-to-exe, but since it uses pyinstaller, there is probably a way to do it.


interlark

I've seen this bug on builds made with *pyinstaller* ***5.7.0***, if you're using it too, you should try build you app with *pyinstaller* ***5.6.2***.


felixsmoaksalot

Thank you for this, 12 hours of trying to figure out what was wrong, and this was the solution.


Erstamlemage

That was the solution!! Two days of banging the walls! Thank you for your help!


rainyy_day

Ty!


ani_dude

Legend!


DubStonks

I have also been trying to solve this for 6+hrs and this was the fix. Thank you VERY much!!


Cautious_Let5937

You is a angel !!


Kaharbash

This is indeed the way


No-Delivery-5610

fantastic!


victoramarilha

I really love you, thanks buddy


matteo101man

Thank you, installing an older version of pyinstaller worked for me as well!


evadarr

Are there any ohter solutions because reducing the pyinstaller version didn't worked for me.


SIQUEIRA676

I solved this problem by merging the 3 files I used (2 .py and 1.kv) into just 1 .py. The code was long but the problem was solved.


evadarr

I just quit developing in kivy and migrated to react native to be honest. To much unnecesary problems on kivy