How to Install Tkinter in Windows?
In this article, we will look into the various methods of installing Tkinter on a Windows machine.
Note: Python already comes bundled with Tkinter. But if you still face any error with Tkinter, follow along with the article for manual installation.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning - Basic Level Course
For PIP Users:
Open up the command prompt and use the below command to install Tkinter:
pip install tk
The following message will be displayed once the installation is completed:
To verify the installation use the tk._test() function. Use the below screenshots for reference:
For conda Users:
Conda users can open up the Anaconda Power Shell and use the below command to install Tkinter:
conda install -c anaconda tk
You will get the following message once the installation is completed:
To verify the installation run the below code: