3

I'm new to python, I hope someone can help me with this problem. i'm using a mac M1 with OS Monterey 12.5.1. I'm using Python Version Python 3.8.9 (default, Apr 13 2022, 08:48:06) in Visual studio code. (I also tried to run the code in Pycharm and it generates the same black window error.

I am running a simple calculator code in Python, but when I run the buttons come out correctly, but the rest is always black, as attached in the image. Try to download the code directly from Github, run it and it comes out the same. I tried it on another mac with an older operating system and the same thing happens. I run the code on Windows and it works without problem. error generated when executing graphic interface with the library used code calculator I tried to run other projects in tkinter and they all come out in a black window.

Saturn58
  • 31
  • 4
  • Please show the code you're using. – wkl Sep 01 '22 at 16:47
  • attached as image , {used code calculator} – Saturn58 Sep 01 '22 at 16:53
  • What do you get from `print(ventana.cget('background'))`? If it is `systemMetalBackground` then it is a unresolved but known issue. You could just change the background color as desired. – Thingamabobs Sep 01 '22 at 16:59
  • applying that command generates the following message, and the window comes out black, not as a background, but as a runtime error. DEPRECATION WARNING: The system version of Tk is deprecated and may be removed in a future release. Please don't rely on it. Set TK_SILENCE_DEPRECATION=1 to suppress this warning. systemWindowBody – Saturn58 Sep 01 '22 at 17:08
  • AFAIK, the Tk stuff that you get from Apple with macOS is hopelessly outdated and unusable. I tend to go to the Python foundation website and install straight from the horse's mouth. Then it all works well. – Mark Setchell Sep 01 '22 at 17:23
  • I understand, i will investigate how do to what you tell me, thanks for you contribution. – Saturn58 Sep 01 '22 at 17:36
  • I solved the problem, I made the version change to Python 3.10.6. Thank you all. – Saturn58 Sep 01 '22 at 19:43
  • I was able to figure this out after some digging - [see here](https://stackoverflow.com/questions/73056296/tkinter-on-mac-shows-up-as-a-black-screen/73186351#73186351). The solution I found works, but has some caveats...YMMV – JRiggles Sep 02 '22 at 18:53

0 Answers0