![]() |
VOOZH | about |
In this article, we will look into the various methods of installing Tkinter on a Windows machine.
Note : For Python 3 tkinter should already be included with your Python installation. However, if itβs not available or youβre encountering issues, you can install or reinstall it using the following steps:
If you donβt have tkinter installed, the easiest way is to reinstall Python from the official website and ensure that the tkinter package is included during installation.
However, if you want to ensure all dependencies are managed via pip (though tkinter is part of the Python standard library in most cases), you can install the tk package using pip.
Open up the command prompt and use the below command to install Tkinter:
pip install tkThis installs the Python tk bindings, which is what tkinter depends on. The following message will be displayed once the installation is completed:
π installing tkinter using pipTo verify the installation use the tk._test() function. Use the below screenshots for reference:
Output:
π verifying Tkinter installationConda users can open up the Anaconda Power Shell and use the below command to install Tkinter:
conda install -c anaconda tkYou will get the following message once the installation is completed:
π installing Tkinter using condaTo verify the installation run the below code: