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?

2
  • 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, 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
    – rob
    Apr 23, 2014 at 6:47

1 Answer 1

8

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 and acknowledge that you have read and understand our privacy policy and code of conduct.

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