0

I am using MacOS Ventura 13.2, Visual Studio Code and Python 3.9 Tkinter will not show widgets inside of the window (Although the window does appear, and can be resized from the script using root.geometry('500x500').

I also attempted in the terminal and it was the same. It was also the same with PyCharm. Here is my code:

from tkinter import *

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

testlabel = Label(root, text="hello", fg="White", font=("Helvetica", 14))
testlabel.pack()

root.mainloop()

I also attempted label.grid(column=0, row=0) But nothing worked.

3
  • Try fg="black". Does the text show up? Commented Apr 16, 2023 at 5:39
  • I already tried that. It didn't work. Commented May 5, 2023 at 3:34
  • On Ubuntu 22.10 with python 3.10.7 your code runs properly.Probably a MacOs issue.See if this post helps. Commented May 6, 2023 at 2:34

1 Answer 1

2

I ran into this issue when using PyCharm.
And I solved it eventually by changing the interpreter to the version(3.13) I had installed on my system (Sequoia 15.3.2)
The local one in my project was also 3.9, which was a set up a long while ago.

Sign up to request clarification or add additional context in comments.

1 Comment

Ok, I've moved on from macos already, but I'll mark this as the answer to help anyone else.

Your Answer

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.