command to install tkinter in python code example Example 1: install tkinter pip3 install tk Example 2: pip install tkinter python -m pip install tk