Install Tkinter on macOS

Install Tkinter on macOS
Heads up! You've already completed this tutorial.

Before you start the Tkinter tutorial you will need to have a working installation of Tkinter on your system. If you don't have either set up yet, the following steps will guide you through how to do this on macOS.

This guide is also available for Ubuntu Linux. On Windows, Tkinter is installed by default with Python.

Install Tkinter on macOS

To install Python and Tkinter on macOS I recommend you use Homebrew. Homebrew is a package manager for command-line software on macOS. Homebrew has both Python 3 and Tkinter available in their repositories.

Homebrew -- the missing package manager for macOS Homebrew -- the missing package manager for macOS

To install homebrew run the following from the command line --

bash
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

This is also available to copy and paste from the Homebrew homepage.

Once Homebrew is installed you can then install Python with --

PyQt/PySide 1:1 Coaching with Martin Fitzpatrick — Get one on one help with your Python GUI projects. Working together with you I'll identify issues and suggest fixes, from bugs and usability to architecture and maintainability.

Book Now 60 mins ($195)

bash
brew install python3

With Python installed, you can then install Tkinter using Homebrew with --

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 ]]

bash
brew install python-tk

Packaging Python Applications with PyInstaller by Martin Fitzpatrick — This step-by-step guide walks you through packaging your own Python applications from simple examples to complete installers and signed executables.

More info Get the book

Well done, you've finished this tutorial! Mark As Complete
[[ user.completed.length ]] completed [[ user.streak+1 ]] day streak
Martin Fitzpatrick

Install Tkinter on macOS 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. Martin founded PythonGUIs to provide easy to follow GUI programming tutorials to the Python community. He has written a number of popular Python books on the subject.