My Idle is throwing errors that and says tkinter
can't be imported.
Is there a simple way to install tkinter
via pip
or easy_install
?
There seem to be a lot of package names flying around for this...
This and other assorted variations with tkinter-pypy
aren't working.
pip install python-tk
I'm on Windows with Python 2.7 and can't apt-get
.
Thanks.
The Tkinter library is built in with every Python installation. And since you are on windows, I believe you installed python through the binaries on their website?
if so, Then most probably you are typing the command wrong. It should be:
import Tkinter as tk
Note the capital T at the beginning of Tkinter.
For Python 3,
import tkinter as tk
When installing make sure that under
Tcl/Tk
you selectWill be installed on hard drive
. If it is installing with a cross at the left then Tkinter will not be installed.The same goes for Python 3:
I solved the same problem using these two commands 100%
When you install python for Windows, use the standard option or install everything it asks. I got the error because I deselected tcl.