sudo apt-get install python3-tk Installs tkinter for Python3.x.x

Sources:

https://stackoverflow.com/questions/6084416/tkinter-module-not-found-on-ubuntu https://pythonprogramming.net/python-3-tkinter-basics-tutorial/

Answer from Elder Geek on askubuntu.com
๐ŸŒ
Python documentation
docs.python.org โ€บ 3 โ€บ library โ€บ tkinter.html
tkinter โ€” Python interface to Tcl/Tk
February 23, 2026 - The only kinds of variables for which this works are variables that are subclassed from a class called Variable, defined in tkinter. There are many useful subclasses of Variable already defined: StringVar, IntVar, DoubleVar, and BooleanVar. To read the current value of such a variable, call the get() method on it, and to change its value you call the set() method. If you follow this protocol, the widget will always track the value of the variable, with no further intervention on your part. ... import tkinter as tk class App(tk.Frame): def __init__(self, master): super().__init__(master) self.pack() self.entrythingy = tk.Entry() self.entrythingy.pack() # Create the application variable.
Discussions

How do i install Tkinter
tkinter is in the standard library. More on reddit.com
๐ŸŒ r/learnpython
16
11
August 10, 2022
python - ImportError: No module named '_tkinter', please install the python3-tk package - Stack Overflow
But I'm still getting the same import error ImportError: No module named '_tkinter', please install the python3-tk package. More on stackoverflow.com
๐ŸŒ stackoverflow.com
python - Can't import tkinter (or Tkinter) - Stack Overflow
I am trying to import Tkinter to my project using Python 2.7 and instead I get the error: ImportError: No module named tkinter Before anyone says it, I have tried both "Tkinter" and "tkinter" but... More on stackoverflow.com
๐ŸŒ stackoverflow.com
linux - Install tkinter for Python - Stack Overflow
I am trying to import Tkinter. However, I get an error stating that Tkinter has not been installed: ImportError: No module named _tkinter, please install the python-tk package I could probably ins... More on stackoverflow.com
๐ŸŒ stackoverflow.com
๐ŸŒ
CustomTkinter
customtkinter.tomschimansky.com
Official Documentation And Tutorial | CustomTkinter
CustomTkinter is a python desktop UI-library based on Tkinter, which provides modern looking and fully customizable widgets. With CustomTkinter you'll get a consistent look across all desktop platforms (Windows, macOS, Linux).
๐ŸŒ
Educative
educative.io โ€บ answers โ€บ how-to-import-tkinter-in-python
How to import Tkinter in Python
#import tkinter module import tkinter as tk #create window window = tk.Tk() #provide size to window window.geometry("300x300") #add text label tk.Label(text="Hello from Educative !!!").pack() window.mainloop()
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-gui-tkinter
Python Tkinter - GeeksforGeeks
January 23, 2026 - Events in Tkinter are captured and managed using a mechanism called bindings. A binding links an event to a callback function (also known as an event handler) that is called when the event occurs. Below is the syntax: ... Key events are triggered when a user presses a key on the keyboard. Mouse events are triggered by mouse actions, such as clicking or moving the mouse. ... import tkinter as tk def on_key_press(event): print(f"Key pressed: {event.keysym}") def on_left_click(event): print(f"Left click at ({event.x}, {event.y})") def on_right_click(event): print(f"Right click at ({event.x}, {eve
๐ŸŒ
TkDocs
tkdocs.com โ€บ tutorial โ€บ install.html
TkDocs Tutorial - Installing Tk
Most Linux distributions install a recent version of Python by default, or it can be installed using their package manager. Some Linux distributions separate out Tkinter support into a separate package that isn't automatically installed. If so, they'll usually notify you how to proceed when you try to import tkinter.
Find elsewhere
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ ref_module_tkinter.asp
Python tkinter Module
import tkinter as tk print('tkinter is available') print('Standard GUI toolkit for Python') Try it Yourself ยป
๐ŸŒ
Real Python
realpython.com โ€บ ref โ€บ stdlib โ€บ tkinter
tkinter | Python Standard Library โ€“ Real Python
Itโ€™s the standard for creating desktop applications in Python, allowing developers to build cross-platform graphical user interfaces with ease. ... >>> import tkinter as tk >>> root = tk.Tk() >>> label = tk.Label(root, text="Hello, Tkinter!") ...
๐ŸŒ
Real Python
realpython.com โ€บ python-gui-tkinter
Python GUI Programming: Your Tkinter Tutorial โ€“ Real Python
December 7, 2024 - This installs the Python GUI Tkinter module. ... If youโ€™re unable to get a working Python installation on your flavor of Linux, then you can build Python with the correct version of Tcl/Tk from the source code. For a step-by-step walk-through of this process, check out the Python 3 Installation & Setup Guide. You may also try using pyenv to manage multiple Python versions. With your Python shell open, the first thing you need to do is import the Python GUI Tkinter module:
๐ŸŒ
GitHub
github.com โ€บ PySimpleGUI โ€บ PySimpleGUI โ€บ issues โ€บ 5022
Bug: "ModuleNotFoundError: No module named '_tkinter" when importing PySimpleGUI ยท Issue #5022 ยท PySimpleGUI/PySimpleGUI
December 11, 2021 - /sonautics/sonascan_releases/sonascan_2021209r1/venv/bin/python /sonautics/sonascan_releases/sonascan_2021209r1/src/main.py Traceback (most recent call last): File "/sonautics/sonascan_releases/sonascan_2021209r1/src/main.py", line 118, in <module> import PySimpleGUI as sg File "/sonautics/sonascan_releases/sonascan_2021209r1/venv/lib/python3.10/site-packages/PySimpleGUI/__init__.py", line 3, in <module> from .PySimpleGUI import * File "/sonautics/sonascan_releases/sonascan_2021209r1/venv/lib/python3.10/site-packages/PySimpleGUI/PySimpleGUI.py", line 115, in <module> import tkinter as tk File "/usr/lib/python3.10/tkinter/__init__.py", line 37, in <module> import _tkinter # If this fails your Python may not be configured for Tk ModuleNotFoundError: No module named '_tkinter' Process finished with exit code 1
Author ย  mcgregor94086
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ how-to-install-tkinter-in-python
How to install Tkinter in Python?
May 31, 2024 - Tkinter is typically included with Python installations by default. Use the import test to verify availability, and install using pip install tk or platform-specific package managers if needed.
๐ŸŒ
Python GUIs
pythonguis.com โ€บ installation โ€บ install tkinter on ubuntu linux
How to Install Tkinter on Ubuntu Linux โ€” Step-by-Step Guide
3 weeks ago - After the installation is finished, you can verify that Tkinter is correctly installed by starting a Python interactive session and importing the tkinter package:
Top answer
1 of 4
33

from Tkinter import * imports every exposed object in Tkinter into your current namespace. import Tkinter imports the "namespace" Tkinter in your namespace and import Tkinter as tk does the same, but "renames" it locally to 'tk' to save you typing

let's say we have a module foo, containing the classes A, B, and C.

Then import foo gives you access to foo.A, foo.B, and foo.C.

When you do import foo as x you have access to those too, but under the names x.A, x.B, and x.C. from foo import * will import A, B, and C directly in your current namespace, so you can access them with A, B, and C.

There is also from foo import A, C wich will import A and C, but not B into your current namespace.

You can also do from foo import B as Bar, which will make B available under the name Bar (in your current namespace).

So generally: when you want only one object of a module, you do from module import object or from module import object as whatiwantittocall.

When you want some modules functionality, you do import module, or import module as shortname to save you typing.

from module import * is discouraged, as you may accidentally shadow ("override") names, and may lose track which objects belong to wich module.

2 of 4
4

You can certainly use

import Tkinter

However, if you do that, you'd have to prefix every single Tk class name you use with Tkinter..

This is rather inconvenient.

On the other hand, the following:

import Tkinter as tk

sidesteps the problem by only requiring you to type tk. instead of Tkinter..

As to:

from Tkinter import *

it is generally a bad idea, for reasons discussed in Should wildcard import be avoided?

๐ŸŒ
Python.org
discuss.python.org โ€บ python help
Need help importing Tkinter - Python Help - Discussions on Python.org
February 1, 2025 - Hello, Python do you know any cause for the Tkinter package for not installing or importing?