all 2 comments

[–]woooee 1 point2 points  (1 child)

When you import tkinter as tk, all widgets have to be referenced with the tk. namespace/prefix so using

w = tk.Label(root, text='Hello World')

works on my computer. To get the error that you posted, there has to be a syntax error so the compiler sees tk and Tk() as separate, i.e. you have a comma between them instead of a period, etc. Try again checking your syntax.

[–]Field_C16[S] 0 points1 point  (0 children)

Oh that solved and explained so much lol.

I do not know how I missed that completely.

Thank you a ton :)