0

Context: I am using an M1 mac on Ventura 13.3.1, and I've set up a pyenv virtual env using python 3.10.6

When I run my application (code block attached below) I get this blank window with only the label being applied:

import tkinter as tk

root = tk.Tk()

root.title('visual')
root.geometry('400x400')

text = tk.Label(root, text="hello", height=40, width=100, bg='red', font=('Arial', 20))
text.pack()


root.mainloop()

empty tkinter window

I've tried every solution under the sun (if the sun was stackoverflow), and nothing relieves my problems. The only progress I've made is getting it to go from a black window to this.

  • This works fine for me on an M2 mac. Just to clarify: you're not seeing the red color and you're also not seeing the text, correct? And the code in the question is exactly what you're running? – Bryan Oakley May 17 '23 at 22:19
  • it's exactly as you see here, and the result is the screenshot attached above. So essentially nothing, I'm puzzled – Eidarus Omar May 18 '23 at 02:21
  • Are you running it from the command line, or from within an IDE. I'm not sure if it matters, but if you aren't running from the command line I suggest you try that to see if it changes anything. – Bryan Oakley May 18 '23 at 03:04
  • I know this isn't precisely the same problem, but I have an [answer here](https://stackoverflow.com/a/73186351/8512262) that shows how to update tkinter on a Mac. Maybe that will help? – JRiggles May 18 '23 at 12:12
  • I've ran it from both the command line and vscode, same issue either way. @JRiggles I've tried that solution as well, but no luck – Eidarus Omar May 19 '23 at 03:10

0 Answers0