Hi there, wonderful coders. This article will serve as a transcript for my install tkinter in python video on Code Jana channel. It will also help you copy & paste the code directly to your code editor.
Here are the steps to Install Tkinter in Python:
Tkinter is already included with Python installation package.
Go to your browser of choice, then head over to python.org, & download latest Python package for your operating system.
At the time of this writing, Python has been upgraded to version 3.9.2.
At the time of video recording, it was 3.8.3.
Click the download button & Python 3.x.x will be downloaded in your computer.
After that, locate the downloaded executable file & begin installing Python in your computer.
But don’t be in a rush. You need to click on Add to Path, so that Python script folder path will be added to environment variables & you’ll be able to access Python shell from Windows Command Prompt & Powershell.
Now, in case you already had Python installed in your system & you follow above steps then you’ll see, 3 options, Modify, Repair, Uninstall.
So, if for some reason your Tkinter has become corrupt, then you can Repair your Python Installation.
Make sure that tc/tk and IDLE is checked ON. After that, just hit Next & it will be reinstalled in your computer.
After the installation is finished. You can check tkinter installation with this small example:
Open command prompt & type python & press enter. You will then enter inside Python shell.
Follow this program as it afterwards.
Try this simple program & let me know if you face any issues.
from tkinter import * from tkinter import ttk root=Tk() ttk.Button(root,text="Hello Universe").grid() root.mainloop()