4

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?

  • 1
    a 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. – rob Apr 22 '14 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 – rob Apr 23 '14 at 6:47
7

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.