Skip to content
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

Black screen and restart required after importing kivy.uix.textinput #8097

Closed
JMrziglod opened this issue Jan 5, 2023 · 9 comments
Closed
Labels
awaiting-reply Waiting for reply from issue opener, will be closed if no reply

Comments

@JMrziglod
Copy link

JMrziglod commented Jan 5, 2023

Software Versions

  • python : 3.10.2.final.0
  • python-bits : 64
  • OS : Darwin
  • OS-release : 21.6.0
  • machine : arm64
  • processor : arm
  • Kivy: v2.1.0
  • Kivy installation method: pip install kivy

Describe the bug
After importing the TextInput class from kivy.uix.textinput - without building an app or anything -, I get a black screen, the screen resolution was changed and keyboard inputs are not possible anymore. I had to restart my Mac Book.

I tried it out on another MacBook which has an Intel chip and the code worked. So it is probably a problem with the M1 chip.

Expected behavior
It shouldn't do anything except import TextInput.

To Reproduce

from kivy.app import App
from kivy.uix.textinput import TextInput

Logs

[INFO   ] [Logger      ] Record log in /Users/JMrziglod/.kivy/logs/kivy_23-01-05_4.txt
[INFO   ] [Kivy        ] v2.1.0
[INFO   ] [Kivy        ] Installed at "/Users/JMrziglod/Library/Python/3.10/lib/python/site-packages/kivy/__init__.py"
[INFO   ] [Python      ] v3.10.2 (v3.10.2:a58ebcc701, Jan 13 2022, 14:50:16) [Clang 13.0.0 (clang-1300.0.29.30)]
[INFO   ] [Python      ] Interpreter at "/usr/local/bin/python3"
[INFO   ] [Logger      ] Purge log fired. Processing...
[INFO   ] [Logger      ] Purge finished!
[INFO   ] [Factory     ] 189 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_imageio, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO   ] [Text        ] Provider: sdl2
[INFO   ] [Window      ] Provider: sdl2
[INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system
[INFO   ] [GL          ] Backend used <sdl2>
[INFO   ] [GL          ] OpenGL version <b'2.1 Metal - 76.3'>
[INFO   ] [GL          ] OpenGL vendor <b'Apple'>
[INFO   ] [GL          ] OpenGL renderer <b'Apple M1'>
[INFO   ] [GL          ] OpenGL parsed version: 2, 1
[INFO   ] [GL          ] Shading version <b'1.20'>
[INFO   ] [GL          ] Texture max size <16384>
[INFO   ] [GL          ] Texture max units <16>
[INFO   ] [Window      ] auto add sdl2 input provider
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
[INFO   ] [Base        ] Start application main loop
[INFO   ] [GL          ] NPOT texture support is available
[INFO   ] [Base        ] Leaving application in progress...
@Ahd999
Copy link

Ahd999 commented Jan 6, 2023

Well it is doing nothing except importing TextInput. The logs you see are default logs that kivy shows on imports.
If you wish to see the text input then you have to create a kivy app class and run it.

@JMrziglod
Copy link
Author

I expected it to import TextInput but it crashed my MacBook instead. The import fails.

@Ahd999
Copy link

Ahd999 commented Jan 6, 2023

It dosent matter which system are you using be it mac, win or Lin all of them require you to write one thing in your code I. E. App().run() without that it appears to crash though it is the default behaviour in kivy, furthermore your logs are normal they don't indicate any error.

@JMrziglod
Copy link
Author

Are you saying that the default behaviour is to freeze my computer, make the screen black and grab all my keyboard inputs just because I imported a module? I don't think this makes much sense. Is this documented somewhere?

@Ahd999
Copy link

Ahd999 commented Jan 6, 2023

Oh ohk yup that's an issue,forgive me, btw why don't you try and use some other kivy version?

@misl6
Copy link
Member

misl6 commented Jan 7, 2023

Hi @JMrziglod !

I've tested both master and 2.1.0 versions on M1 Pro and everything is working as expected. No crashes or freezes:

(venv) mirko@Mirkos-MacBook-Pro kivy % python                                                                      
Python 3.11.0 (v3.11.0:deaf509e8f, Oct 24 2022, 14:43:23) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from kivy.app import App
[INFO   ] [Logger      ] Record log in /Users/mirko/.kivy/logs/kivy_23-01-07_25.txt
[INFO   ] [Kivy        ] v2.2.0.dev0
[INFO   ] [Kivy        ] Installed at "/Users/mirko/Documents/projects/kivy/kivy/__init__.py"
[INFO   ] [Python      ] v3.11.0 (v3.11.0:deaf509e8f, Oct 24 2022, 14:43:23) [Clang 13.0.0 (clang-1300.0.29.30)]
[INFO   ] [Python      ] Interpreter at "/Users/mirko/Documents/projects/kivy/venv/bin/python"
[INFO   ] [Logger      ] Purge log fired. Processing...
[INFO   ] [Logger      ] Purge finished!
[INFO   ] [Factory     ] 190 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_imageio, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)
>>> from kivy.uix.textinput import TextInput
[INFO   ] [Window      ] Provider: sdl2
[INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system
[INFO   ] [GL          ] Backend used <sdl2>
[INFO   ] [GL          ] OpenGL version <b'2.1 Metal - 83'>
[INFO   ] [GL          ] OpenGL vendor <b'Apple'>
[INFO   ] [GL          ] OpenGL renderer <b'Apple M1 Pro'>
[INFO   ] [GL          ] OpenGL parsed version: 2, 1
[INFO   ] [GL          ] Shading version <b'1.20'>
[INFO   ] [GL          ] Texture max size <16384>
[INFO   ] [GL          ] Texture max units <16>
[INFO   ] [Window      ] auto add sdl2 input provider
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
[INFO   ] [Text        ] Provider: sdl2
Python 3.10.8 (v3.10.8:aaaf517424, Oct 11 2022, 10:14:40) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from kivy.app import App
[WARNING] [Config      ] Older configuration version detected (25 instead of 24)
[WARNING] [Config      ] Upgrading configuration in progress.
[INFO   ] [Logger      ] Record log in /Users/mirko/.kivy/logs/kivy_23-01-07_27.txt
[INFO   ] [Kivy        ] v2.1.0
[INFO   ] [Kivy        ] Installed at "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/kivy/__init__.py"
[INFO   ] [Python      ] v3.10.8 (v3.10.8:aaaf517424, Oct 11 2022, 10:14:40) [Clang 13.0.0 (clang-1300.0.29.30)]
[INFO   ] [Python      ] Interpreter at "/Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10"
[INFO   ] [Logger      ] Purge log fired. Processing...
[INFO   ] [Logger      ] Purge finished!
[INFO   ] [Factory     ] 189 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_imageio, img_dds, img_sdl2 (img_pil, img_ffpyplayer ignored)
>>> from kivy.uix.textinput import TextInput
[INFO   ] [Window      ] Provider: sdl2
[INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system
[INFO   ] [GL          ] Backend used <sdl2>
[INFO   ] [GL          ] OpenGL version <b'2.1 Metal - 83'>
[INFO   ] [GL          ] OpenGL vendor <b'Apple'>
[INFO   ] [GL          ] OpenGL renderer <b'Apple M1 Pro'>
[INFO   ] [GL          ] OpenGL parsed version: 2, 1
[INFO   ] [GL          ] Shading version <b'1.20'>
[INFO   ] [GL          ] Texture max size <16384>
[INFO   ] [GL          ] Texture max units <16>
[INFO   ] [Window      ] auto add sdl2 input provider
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
[INFO   ] [Text        ] Provider: sdl2

Also, our Github Actions M1 (non-pro) self-hosted runner, is not reporting any issue.

Is this issue happening constantly?

@misl6 misl6 added the awaiting-reply Waiting for reply from issue opener, will be closed if no reply label Jan 9, 2023
@github-actions
Copy link

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have the means to take action. Please reach out if you have or find the answers we need so that we can investigate further.

@jmdc112596
Copy link

The same thing happened to me. Imported the line below, everything froze, screen went black, my screen came back had lower resolution and was much smaller. Nothing working but mouse inputs. Keyboard input didn't work. Had to restart computer to fix. I was importing in a Jupyter Notebook, not sure if this is relevant. Thanks.

Kivy 2.3.0
Python 3.11.7
MacOS Sonoma 14.0
2.6 GHz 6-Core Intel Core i7

from kivy.uix.textinput import TextInput

@Julian-O
Copy link
Contributor

Julian-O commented Feb 7, 2024

@jmdc112596: Try the support channels. Sounds like you are making the same mistake as the OP. Importing in Kivy has side-effects, alas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-reply Waiting for reply from issue opener, will be closed if no reply
Projects
Status: Done
Development

No branches or pull requests

5 participants