HOWTO · Tkinter
Install and Verify Tkinter on Windows 11 (64-Bit)
Install or repair Tkinter on 64-bit Windows 11, verify the exact Python interpreter, and fix missing-module, Tcl/Tk, PATH, and IDE errors.
On this page
You normally do not download Tkinter as a separate package on 64-bit Windows 11. The official CPython runtime includes the tkinter module and the Tcl/Tk libraries it needs. First run the built-in test with the same Python interpreter that your project uses. If the test fails, install a full official Python runtime or repair the existing installation with Tcl/Tk support instead of running pip install tkinter.
These instructions target Python 3 on an ordinary x86-64 Windows 11 computer. Python 3.14 is the current feature series and supports Windows 11; use a different supported Python release only when your project has a specific compatibility requirement.
Check Whether Tkinter Is Already Installed
Open Command Prompt or PowerShell and try the Python launcher used by your project:
py -m tkinter
If py is unavailable but python starts the correct interpreter, use:
python -m tkinter
According to the official Tkinter documentation, this command should open a small demonstration window and display the installed Tcl/Tk version. A visible window proves more than a successful import: Python found tkinter, loaded its compiled _tkinter extension and Tcl/Tk libraries, and connected Tk to the Windows desktop. Close the demonstration window before continuing.
Use py -m tkinter rather than guessing whether python, python3, or an IDE points to the intended installation. If several Python runtimes are installed, a test can succeed in one interpreter while the project still fails in another.
The following headless check is useful when you want exact version information without creating a Tk window:
import tkinter as tk
tcl = tk.Tcl()
print("Tkinter import: OK")
print(f"Tk version: {tk.TkVersion:.1f}")
print(f"Tcl/Tk patch level: {tcl.eval('info patchlevel')}")
One tested environment produced:
Tkinter import: OK
Tk version: 8.6
Tcl/Tk patch level: 8.6.12
The patch level can differ on your Windows installation. The important result is that the import and Tcl interpreter initialization both succeed. This check does not create a graphical root window, so it cannot prove that a remote or restricted desktop session can display windows; use python -m tkinter for that final check.
Install Python and Tkinter on 64-Bit Windows 11
If Python is not installed, obtain the Python Install Manager from python.org or install the identical manager from the Microsoft Store. The manager is the current official Windows path and makes the python, py, and pymanager commands available. Starting python when no runtime exists installs the current stable runtime by default.
For a normal 64-bit Intel or AMD Windows 11 PC, select the x86-64 runtime. ARM64 is for Windows devices with an ARM processor; it is not another name for conventional 64-bit Windows. Matching the runtime to the processor is preferable, but Tkinter itself does not require every library in a project to be manually selected by “64-bit” labels.
The traditional 64-bit CPython installer is also available during the Python 3.14 and 3.15 series. If you use it, the default installation includes the standard library and Tcl/Tk. In a customized installation, keep tcl/tk and IDLE enabled. Adding python.exe to PATH is convenient when you want the python command, but it is not what installs Tkinter; the py command can select a runtime without that PATH option.
After installation, open a new terminal so it receives the updated command aliases, then repeat py -m tkinter. Do not use the Windows embeddable distribution for ordinary desktop development. It is a minimal application-local runtime and is not a substitute for a full installation with user-interface components.
Most importantly, do not run either of these as a Windows Tkinter repair:
pip install tkinter
pip install tk
tkinter is part of CPython, not a separately maintained Tkinter wheel on PyPI. A package named tk is unrelated to repairing CPython’s _tkinter extension and bundled Tcl/Tk runtime. A successful installation of some similarly named package would therefore not fix the underlying component.
Repair a Python Installation That Is Missing Tkinter
If py -m tkinter reports ModuleNotFoundError: No module named 'tkinter', first identify which Python distribution produced the error. An official full Windows installation normally includes Tkinter; embeddable, custom-built, or deliberately minimized distributions may not.
For a traditional python.org installation, open Settings > Apps > Installed apps, select the relevant Python version, and choose Modify or Repair. In the feature selection, ensure tcl/tk and IDLE is enabled. If modification is unavailable or the installation is damaged, reinstall that supported Python version from python.org with the default components. Repair the interpreter that actually runs the project, not merely the newest Python listed in Settings.
For a runtime managed by the Python Install Manager, use its installed-runtime list to see what is present:
py list
Install or replace a full managed runtime rather than copying tkinter, _tkinter.pyd, or Tcl folders from another Python version. Those pieces are version- and architecture-dependent. Mixing files can change a missing-module error into a DLL-loading or init.tcl error that is harder to diagnose.
If you intentionally use Conda, manage Tcl/Tk inside that Conda environment. Do not apply a Conda remedy to python.org CPython, and do not assume that repairing the system Python changes an already-created Conda environment. Distribution-specific installation belongs to the distribution that owns the interpreter.
Verify the Exact Python Interpreter
When Tkinter works in a terminal but fails in VS Code, PyCharm, Jupyter, or another IDE, the most likely problem is interpreter selection rather than a missing global download. Run the version probe inside the failing project and inspect the executable as well as the module location:
import sys
import tkinter
print(sys.executable)
print(tkinter.__file__)
Both paths should belong to the environment you intended to run. In an IDE, select that interpreter for the project, restart the integrated terminal or kernel, and run the probe again. A virtual environment normally uses the standard library of the base Python that created it. If that base installation lacks working Tcl/Tk support, recreate the environment after repairing or replacing the base runtime.
Run a Minimal Tkinter Window
Once the built-in test works, save the following as minimal_window.py:
import tkinter as tk
from tkinter import ttk
root = tk.Tk()
root.title("My First Tkinter App")
close_button = ttk.Button(root, text="Close", command=root.destroy)
close_button.pack(padx=40, pady=24)
root.mainloop()
Run it with the same launcher you verified:
py minimal_window.py
The result is a small window with a Close button. Clicking the button calls root.destroy, ends the event loop, and closes the application.
The code uses tkinter.ttk for the themed button rather than importing every Tkinter name with from tkinter import *. Explicit module names make it easier to see which toolkit owns each object and avoid accidental name collisions in a larger program.
Fix Common Windows Tkinter Errors
If python opens the Microsoft Store or is not recognized, try py first. With the current Python Install Manager, open Manage app execution aliases from the Start menu and confirm that the Python aliases are enabled. Also reopen the terminal after installation. Adding a directory to PATH can affect which interpreter python selects, but it does not add Tcl/Tk to an incomplete runtime.
If the error names _tkinter, a Tcl DLL, or says it cannot find a usable init.tcl, the Python layer may exist while its compiled extension or Tcl/Tk data is missing or inconsistent. Repair or reinstall one complete distribution of the same version and architecture. Avoid downloading individual DLLs or copying a tcl directory from another machine; that bypasses the installer’s version matching and can conceal the actual mismatch.
If an import succeeds but tk.Tk() raises a display-related TclError, check whether the process is running in a normal interactive Windows desktop. A service, some remote sessions, containers, and headless continuous-integration workers may have no usable graphical display. The headless tk.Tcl() probe can still succeed there because it does not create a window.
Finally, distinguish installation errors from application errors. A traceback about an unknown widget option, a destroyed window, or calling Tkinter from the wrong thread means Tcl/Tk loaded and the application reached GUI code. Reinstalling Python is not the first fix for those errors. Reduce the program to the minimal window above, confirm that it opens, and then restore application code until the failing operation is clear.
The practical sequence is therefore: test the project’s exact interpreter, install or repair official CPython with Tcl/Tk when the component is absent, verify the GUI with python -m tkinter, and only then debug application-specific code.