'When running pyinstaller file it raises an attribute error
I am creating a kivy app in python. When I run the program in the text editor there is no error. But when I convert the file from .py to .exe using pyinstaller the following error is raised.
Window.fullscreen = "auto"
# AttributeError: 'NoneType' object has no attribute 'fullscreen'
How do I fix it?
Code:
from kivy.core.window import Window
Window.fullscreen = 'auto'
App.run()
I looked everywhere but didn't get an answer on how to fix the problem.
Solution 1:[1]
Before compiling your code to .exe, you can also run it using python your_app.py. You are not going to see an error in your "text editor" (before running it) unless it's a typing error.
Anyway, your problem happens because you are trying to assign the value "auto" to "Window.fullscreen" before importing (which is why you are getting the NoneType error, as it doesn't exist yet)
You should do this instead:
from kivy.core.window import Window
Window.fullscreen = 'auto'
Do this before the App.run() method, and it should switch to fullscreen mode.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | nferreira78 |
