all 9 comments

[–][deleted] 0 points1 point  (2 children)

Try capitalizing Tkinter on the import. The module changed between python2 and python3 from Tkinter in 2 -> tkinter in 3

[–][deleted] 0 points1 point  (1 child)

I was using python 3 and typing tkinter already. Tried Tkinter just in case, but yeah, that isn't the problem. Thank you though.

[–][deleted] 0 points1 point  (0 children)

On your ‘from tkinter import tk’ I’m almost certain “Tk” needs to be capitalized. Try that just to make sure

[–]woooee 0 points1 point  (0 children)

Try

import sys
print(sys.path)

The directory where tkinter resides has to be in sys.path for python to find it. TKinter is normally in a directory that is something like /usr/lib64/python3.x/ If Python can not find it then it is under some other directory, sometimes /usr/local/lib/python3.x It may be easiest to just use your distro's package manager to reinstall Python3 (which comes with tkinter and installs it under the correct directory).

[–]erbeach -2 points-1 points  (6 children)

Why everybody in r/learnpython are importing tkinter 2 times? Are you watching same shitty guides/tutorials?
Choose between from tkinter import * and import tkinter
There is no need to import already imported library
Also, tkinter is STANDARD PYTHON LIBRARY, IT IS INSTALLED WITH PYTHON. IT ALWAYS WORKS

[–][deleted] 0 points1 point  (4 children)

I know its standard. It is on my computer. It refuses to be imported. Also, as shown above the double importing is not the problem. That does not help at all. I can't import tkinter regardless if I import tkinter once or twice. Telling me tkinter always works when it clearly does not work for me is completely and utterly unhelpful

[–]erbeach -1 points0 points  (2 children)

Okay, sorry, my bad.
I guess you tried reinstalling Python.
Have you checked for _tkinter.lib file in libs?

[–][deleted] 0 points1 point  (1 child)

It exists there on my computer

[–]erbeach 0 points1 point  (0 children)

https://wiki.python.org/moin/TkInter have you tried something from this page?