I'm considering writing a graphical front-end for low-end wearables (why should the wealthy have all the fun) featuring our prized Raspberry Pi. I know that TK is the standard for python, however I don't know if that needs to be installed or if it's already available. Is it?
-
1a google for "raspberry pi import Tkinter" returns enough responses to indicate that it was not (and may not) be included with Raspian and other RPi distros. The answer below indicates how to install it.– robApr 22, 2014 at 14:43
-
So actually tried "import Tkinter" on a noobs based Raspbian install that was updated on 19th April 2014 and only had Chromium installed on it. And Tkinter was already present– robApr 23, 2014 at 6:47
1 Answer
Tkinter is usually installed as part of Python, however it is not always included by default in builds for Raspberry Pi. For example it would seem fairly pointless to include it in a build targeted specifically at headless applications.
It is simple enough to find out (and fix if necessary) though. You can start Python from the command line (with python
) then import Tkinter
. If you get an error message then exit out of Python and call sudo apt-get install python-tk
to install it.