0

I'm currently learning Tkinter and cannot find a solution to my problem. The Tkinter Label is not showing up in the window and no one has the solution why. I am on MacOS M1 Pro.

from tkinter import *

root = Tk()
# Create label widget
myLabel = Label(root, text="Hello World!")
# Pack it onto the screen
myLabel.pack()

root.mainloop()

Shown Result:

enter image description here

toyota Supra
  • 3,181
  • 4
  • 15
  • 19
David A.
  • 1
  • 2

2 Answers2

-1

Try adding size to your root window.

from tkinter import *

root = Tk()
root.geometry("500x500")

# Create label widget
myLabel = Label(root, text="Hello World!")
# Pack it onto the screen.
myLabel.pack()

root.mainloop()
-1

the problem might be due to tkinter package available on mac os try to unistall and install new fresh package here are as elaborated https://stackoverflow.com/a/73186351/17649464

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 19 '23 at 15:46
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/34412866) – 3nws May 24 '23 at 08:25