Install PyQt6 on macOS

Step-by-step guide to installing PyQt6 on macOS for Python GUI development
Heads up! You've already completed this tutorial.

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

This guide is also available for Linux and Windows.

Note that the following instructions are only for installation of the GPL licensed version of PyQt. If you need to use PyQt in a non-GPL project you will need to purchase an alternative license from Riverbank Computing to release your software.

Install PyQt6 on macOS Using pip

If you already have a working installation of Python 3 on macOS, you can go ahead and install PyQt6 as for any other Python package, using the following --

sh
pip3 install pyqt6

If you don't have an installation of Python 3, you will need to install one first. You can download macOS installers for Python 3 from the Python homepage. Once installed, you should be able to use the pip3 install command above to install PyQt6.

Install PyQt6 on macOS Using Homebrew

Another alternative is to use Homebrew. Homebrew is a package manager for command-line software on macOS. Homebrew has both Python 3 and PyQt6 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 --

sh
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 3 with --

Create GUI Applications with Python & Qt6 by Martin Fitzpatrick — (PyQt6 Edition) The hands-on guide to making apps with Python — Save time and build better with this book. Over 15K copies sold.

Get the book

sh
brew install python3

With Python installed, you can then install PyQt6 as normal, using pip3 install pyqt6, or alternatively choose to install it using Homebrew with --

sh
brew install pyqt6

Verify Your PyQt6 Installation

To confirm that PyQt6 has been installed correctly on your Mac, open a terminal and run --

sh
python3 -c "import PyQt6.QtWidgets; print('PyQt6 installed successfully')"

If you see PyQt6 installed successfully printed without errors, you're ready to start building Python GUI applications with PyQt6. Head over to the PyQt6 tutorial to get started.

PyQt/PySide Development Services — Stuck in development hell? I'll help you get your project focused, finished and released. Benefit from years of practical experience releasing software with Python.

Find out More

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

Install PyQt6 on macOS was written by Martin Fitzpatrick.

Martin Fitzpatrick is the creator of Python GUIs, and has been developing Python/Qt applications for the past 12+ years. He has written a number of popular Python books and provides Python software development & consulting for teams and startups.