-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kivy 2.1.0 with Pyinstaller 5.7.0 kivy\logger.py RecursionError #8074
Comments
@Marcinosoft: Were you able to resolve this? Any workaround? |
Yes, by downgrading PyInstaller to 5.6.2 using:
or using latest PyInstaller 5.7.0 with following addon on top of main Python program:
or
I hope Kivy will include stdout/err check within logger.py soon to be compatible with PyInstaller 5.7.0+. |
@Marcinosoft: Thank you! 😄 👍 |
Same problem here, and solved with os.environ['KIVY_NO_CONSOLELOG'] = '1'. Thank you all. |
Hi everyone! Since we had a lot of improvements to Kivy logging system , did you tried to use Kivy from the |
In my case I used latest released Kivy 2.1.0 installed by: |
In master branch same error |
Yes. Same issue with Kivy 2.2.0.dev0 and latest PyInstaller 5.9.0 Kivy 2.2.0.dev0 installed by: python -m pip install -U kivy --pre --no-deps --index-url https://kivy.org/downloads/simple/ |
I'm also getting the same error with PyInstaller 5.9.0 with kivy[base] v2.1.0 and kivy[full]. The below solution did not work for me.
|
It works but it have to be placed on very top of your python file, before any kivy import |
ah that did the trick. |
The Problem still exists, but the workaround works perfect. |
so in this workaround we will not get the kivy app logs can anyone guide me how to redirect those logs to my own logger. thank you |
Workaround won't output into console only while console is not available, so It's fair enough. By default on Windows log files are stored within %USERPROFILE%\.kivy\logs\ folder. Look for KIVY_HOME environment variable to get or change kivy's root folder containing config.ini with log files folder and files naming. In my opinion these log files are not very valuable and it's good choice to disable it. By default last 100 log files are kept. Same for Android. You can change log folder, log names and retention by changing Kivy configuration: https://kivy.org/doc/stable/guide/config.html |
From the response in the pyinstaller issues: pyinstaller/pyinstaller#7329 (comment) "PyInstaller no longer creates a fake sys.stdout/sys.stderr in windowed mode. Instead, both are left as None which matches what pythonw.exe does. If kivy.logger blindly writes to sys.stderr without first checking that it's there then this is kivy's bug." Anyone working on a PR? I've just started looking to find the error... |
I have a fix, just need to get a PR done - hopefully in the next few days. This fixes the pythonw and pyinstaller issue and preserves the behavior that any writes to sys.stderr are written to the logfile as warning messages. |
Fixed via #8345 |
I did upgrade from Pyinstaller 5.6.2 to 5.7.0 to make exe of Kivy 2.1.0 project based on Python 3.8 on Windows 10 x64 Pro.
Exe produced by Pyinstaller 5.7.0 ends with following exceptions after run:
244 times:
then:
then 242 times:
and the end of exception is:
My main.spec file:
My main.py:
Requirements:
Exactly same Kivy project exe run's fine after downgrade Pyinstaller to:
or by change:
within spec file.
BTW. Increasing recursion limit using sys.setrecursionlimit() doesn't help. Same issue no matter how huge limit is set.
Based on this reply it's Kivy bug:
pyinstaller/pyinstaller#7329 (comment)
This is because PyInstaller no longer creates a fake sys.stdout/sys.stderr in windowed mode. Instead, both are left as None which matches what pythonw.exe does. If kivy.logger blindly writes to sys.stderr without first checking that it's there then this is kivy's bug.
The text was updated successfully, but these errors were encountered: