Install Tkinter on Windows
Install Tkinter on Windows 8, 10 & 11

Heads up! You've already completed this tutorial.

Before you start building GUI applications with Tkinter you will need a working installation of Python & Tkinter on your computer. Helpfully, Tkinter is installed by default with every Python installation on Windows, so you don't need to install it separately. Just download and install Python and you will have Tkinter available to you.

See below for instructions on how to install Python if you do not already have it set up.

Installing Python on Windows

Go to the official Python website's Windows downloads page and download one of the Stable Releases of Python.

Download the latest version of Python You can download any of the stable versions.

You typically want to download the Windows Installer (64-bit) for modern hardware. Unless you know you need the 32 bit version, try the 64-bit first.

Once the download is complete, double click the installer to launch it.

The Python for Windows installer The Python for Windows installer. Ensure sure Add python.exe to PATH is checked.

You'll see the installer welcome screen which describes what the installer will do.

Make sure that Add python.exe to PATH is checked in the installer. This makes it easier to use Python from the command prompt -- you just need to enter "python" to start, rather than the full path to the executable.

When you are ready to being the installation you can click Install Now.

Installing Python Installing Python.

The install will proceed as normal, installing all the required libraries (including Tcl/Tk for Tkinter). Once complete you can exit the installer.

Open a command prompt and start python by entering python. This will start the Python REPL, where you can enter interactive Python code.

The Python REPL The Python REPL for our newly installed Python installation.

You can enter from tkinter import * to confirm that Tkinter has been installed and create a window with Window = Tk() to confirm it is usable.

Importing Tkinter and creating a window in the Python REPL Importing Tkinter and creating a window in the Python REPL.

You can run Python scripts from the command prompt by entering python followed by the script name. Create a file in your code editor and enter the following simple Tkinter example:

python
from tkinter import *
Window = Tk()
Window.mainloop()

Save the file as my_tkinter_app.py in your home folder /Users/<your username>. You can now launch this from the command prompt -- as long as you are in the same folder as the script -- using python my_tkinter_app.py.

Running a Tkinter script from the command line Running a Tkinter script from the command line.

That's it! You can now continue to the Tkinter tutorial to start creating your own Tkinter applications!

The complete guide to packaging Python GUI applications with PyInstaller.
[[ discount.discount_pc ]]% OFF for the next [[ discount.duration ]] [[discount.description ]] with the code [[ discount.coupon_code ]]

Purchasing Power Parity

Developers in [[ country ]] get [[ discount.discount_pc ]]% OFF on all books & courses with code [[ discount.coupon_code ]]
Well done, you've finished this tutorial! Mark As Complete
[[ user.completed.length ]] completed [[ user.streak+1 ]] day streak

Install Tkinter on Windows was written by Martin Fitzpatrick .

Martin Fitzpatrick has been developing Python/Qt apps for 8 years. Building desktop applications to make data-analysis tools more user-friendly, Python was the obvious choice. Starting with Tk, later moving to wxWidgets and finally adopting PyQt.