cesq
cesq

Reputation: 355

Python app not working after using pyinstaller but doesn't give any errors

So I made an app using python and kvlang, and I was trying to get all the files into a one standalone "exe" file. I needed to include the ".kv" file and my main script. I was using pyinstaller and wrote this command:

pyinstaller --onefile -w --icon=download.ico --add-data filefinder.kv;. filefinder.py

And it all went well - no errors or anything but when I launch the app I just get a quick flash of a white window and then it closes. I have determined that the error must be because of some issue with the ".kv" file but I am not able to fix it cause there's no errors, Nothing! I checked and the app works with the "onedir" option but I need to make it smaller in size. I also tried the "auto-py-to-exe" but it gives the same result. I am happy to provide any more info should you need it to help me resolve this issue. Cheers!

Additional info:

System: Windows 10 pro

Python: 3.9.1

kivy: 2.0.0

Pyinstaller: 4.2

Upvotes: 1

Views: 4801

Answers (1)

Daniel Lee
Daniel Lee

Reputation: 8031

Not sure why it doesn't work, but run the exe in command prompt and then when it fails the error message will not disappear.

Add lots of logs to your application, these can be print statements, as those will always end up on stdout.

i.e. on the first entrypoint, print("Running main") When you call your first function: print('calling function_name()')

Once that has finished

print('function_name() complete')

And so on and so forth until you find where exactly the program stops functioning.

Start -> cmd -> navigate to your file using cd -> type in the name of the exe to run it.

Upvotes: 2

Related Questions