You probably need to install it using something similar to the following:

  • For Ubuntu or other distros with Apt:

    sudo apt-get install python3-tk
    
  • For Fedora:

    sudo dnf install python3-tkinter
    

You can also mention a Python version number like this:

  • sudo apt-get install python3.7-tk
    
  • sudo dnf install python3-tkinter-3.6.6-1.fc28.x86_64
    

Finally, import tkinter (for Python 3) or Tkinter (for Python 2), or choose at runtime based on the version number of the Python interpreter (for compatibility with both):

import sys
if sys.version_info[0] == 3:
    import tkinter as tk
else:
    import Tkinter as tk
Answer from d-coder on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-fix-modulenotfounderror-no-module-named-tkinter
How to Fix: ModuleNotFoundError: No module named 'tkinter' - GeeksforGeeks
July 23, 2025 - In this article, we will explore ... it. The "ModuleNotFoundError: No module named 'tkinter'" error occurs when Python cannot find the Tkinter module, which is necessary for creating graphical user interfaces....
🌐
Reddit
reddit.com › r/tkinter › modulenotfounderror: no module named 'tkinter' - cannot run tkinter in visual studio code
r/Tkinter on Reddit: ModuleNotFoundError: No module named 'tkinter' - Cannot run tkinter in Visual Studio Code
November 4, 2022 -

Hi everyone,

Im working in a project using Python and I ran into an issue regarding tkinter. The first time a execute the testing code:

from tkinter import *
from tkinter import ttk
root = Tk()
frm = ttk.Frame(root, padding=10)
frm.grid()
ttk.Label(frm, text="Hello World!").grid(column=0, row=0)
ttk.Button(frm, text="Quit", command=root.destroy).grid(column=1, row=0)
root.mainloop()

Gave me the following error --> ModuleNotFoundError: No module named 'tkinter'

Im using Fedora so I proceed installing tkinter using "sudo dnf install python3-tkinter" command. And when I run "python3 -m tkinter" from terminal it shows the pop-up window. But i keep ran in into the same error when I execute the code from VSC.

Anyone had an idea of how to solve this?

thank you all!

🌐
NVIDIA Developer Forums
forums.developer.nvidia.com › omniverse › isaac sim
ModuleNotFoundError: No module named '_tkinter' - Isaac Sim - NVIDIA Developer Forums
December 12, 2023 - Hi everyone, I am trying to use matplotlib and the Tkinter backend to visualise lidar data on a 2D cartesian graph. However I am running into the issue: import _tkinter # If this fails your Python may not be configured for Tk ModuleNotFoundError: No module named '_tkinter' I have installed ...
🌐
GitHub
github.com › asdf-community › asdf-python › issues › 159
No module named _tkinter with Python 3.11.x (Mac M2) · Issue #159 · asdf-community/asdf-python
April 29, 2023 - -> https://www.python.org/ftp/... ModuleNotFoundError: No module named '_tkinter' WARNING: The Python tkinter extension was not compiled and GUI subsystem has been detected....
Author   fedeotaran
Find elsewhere
🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › using the raspberry pi › troubleshooting
import tkinter as tkinter ImportError: No module named tkinter - Raspberry Pi Forums
python3 -m tkinter - should open a test window on your desktop This works great on the pi desktop but from my remote station the window opens then immediately disappears so I cant quit out
🌐
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
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 360006480380-No-module-named-tkinter
No module named 'tkinter' – IDEs Support (IntelliJ Platform) | JetBrains
October 26, 2019 - Out of despair, I created a new environment using Anaconda3 (and python 3.7) and it worked, no tkinter problem anymore.
🌐
Snapcraft
forum.snapcraft.io › t › modulenotfounderror-no-module-named-tkinter › 28707
ModuleNotFoundError: No module named 'tkinter' - snapcraft - snapcraft.io
February 11, 2022 - Hi Everyone, I am a novice developer and I am currently developing a python tkinter snap which which displays number on the tkinter window using core18 as base. I referred to the below topic on the forum and the window appeared as expected for core 18 as base on Ubuntu 18.04: Tkinter doesn’t work with the python plugin When I try to change the base to core20 , the snap builds and installs without any errors on my Ubuntu 20.04 machine.
🌐
GitHub
github.com › matplotlib › matplotlib › issues › 22583
[Bug]: No module named _tkinter when i have it installed tkinter using pip3 install tk · Issue #22583 · matplotlib/matplotlib
March 2, 2022 - Traceback (most recent call last): File "/home/ayu/b.py", line 4, in import matplotlib.pyplot as plt File "/usr/local/lib/python3.10/site-packages/matplotlib/pyplot.py", line 2230, in switch_backend(rcParams["backend"]) File "/usr/local/lib/python3.10/site-packages/matplotlib/pyplot.py", line 267, in switch_backend class backend_mod(matplotlib.backend_bases._Backend): File "/usr/local/lib/python3.10/site-packages/matplotlib/pyplot.py", line 268, in backend_mod locals().update(vars(importlib.import_module(backend_name))) File "/usr/local/lib/python3.10/importlib/init.py", line 126, in import_mo
Author   ayuuuvauuu
🌐
Python.org
discuss.python.org › python help
importError: No module named tkinter - Python Help - Discussions on Python.org
October 8, 2019 - hello python.org, I have a problem import tkinter module which is summarized as a result. indeed I follow beginner in python, and I use the system linux mint and IDE atom for my project. in the terminal the import of python works marvel well the tcl and others. but the problem is that when ...
🌐
Databricks
community.databricks.com › t5 › support-faqs › my-job-is-failing-with-a-quot-modulenotfounderror-no-module › ta-p › 56896
My job is failing with a "ModuleNotFoundError: No module ...
January 11, 2024 - To install the tkinter package, you can run the following shell command in a notebook: %sh sudo apt-get install python3-tk. To install the - 56896
🌐
Max-everyday
stackoverflow.max-everyday.com › 2022 › 07 › modulenotfounderror-no-module-named-_tkinter
ModuleNotFoundError: No module named ‘_tkinter’ – Max的程式語言筆記
<module> from tkinter import * File "/opt/homebrew/Cellar/[email protected]/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/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'
🌐
Itsourcecode
itsourcecode.com › home › modulenotfounderror: no module named _tkinter
Modulenotfounderror: no module named _tkinter [SOLVED]
April 4, 2023 - The error “ModuleNotFoundError: No module named ‘_tkinter’” generally occurs on Linux if the tkinter module is not installed or it is not properly configured on your computer.
🌐
Kodershop
kodershop.com › questions › unable-to-use-either-import-tkinter-in-python-3-modulenotfounderror
Unable to use either import Tkinter in Python 3. ModuleNotFoundError
Once the installation is complete, you can import the module using the appropriate name for your Python version. For Python 3, use import tkinter as tk, and for Python 2, use import Tkinter as tk. If you want compatibility with both Python versions, you can choose at runtime based on the version number of the Python interpreter: import sys if sys.version_info[0] == 3: import tkinter as tk else: import Tkinter as tk · By following these steps, you should be able to resolve the ModuleNotFoundError and successfully import the Tkinter module in Python.
🌐
Rin Blog
rinblog.org › home › python › how to fix the “_tkinter module not found” error when creating a python gui tool
How to Fix the
January 12, 2026 - The _tkinter module error is caused by the absence of tkinter in the Python installation. Python installed via Homebrew may not include tkinter by default.