1

I am learning Tkinter right now. For some reason, no matter what I try, I can't get the label to appear on a very simple program. I've checked some other questions but none of them seem to work.

I am working on macOS 14.3, with the Apple Silicon chip.

Here is my code:

from tkinter import *
root = Tk()
root.title("Test")
root.geometry('350x200')
lbl = Label(root, text = "TestTest")
lbl.grid()
root.mainloop()

For some reason, only a blank window is appearing.

Blank window named "Test"

asked Oct 15, 2024 at 19:24
5
  • 1
    There are some know issues with tkinter on Mac OS. I have an answer here that might help you out. Commented Oct 15, 2024 at 19:42
  • Thank you for your help. Unfortunately the "pyenv uninstall 3.10.5" command isn't working. I replaced it with my current version of python, but it just tells me that that version isn't installed. Commented Oct 15, 2024 at 19:50
  • 1
    That's to be expected if you don't already have that version of Python installed via pyenv. If that's the case, you can skip that step. I've updated the linked answer to clarify that the uninstall steps are conditional. Commented Oct 15, 2024 at 19:53
  • OK THIS WORKED THANK YOU SO MUCH Commented Oct 15, 2024 at 19:59
  • Glad I could help! If this worked for you, upvotes on the answer are always appreciated - it helps guide others to things that work. Commented Oct 15, 2024 at 20:03

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.