How can I install PyQt5 on Mac?

I'm kind of dodging the question, but the simplest way is to install Homebrew, and just run brew install pyqt or brew install pyqt5.


Meanwhile I have the ultimate way to install PyQt5 on macOS. Don't use Homebrew. It is great for installing Qt5, but for PyQt5 the best way to install it is using

python3 -m pip install PyQt5

This works very quickly and uses universal Python Wheels:

Collecting PyQt5
  Downloading PyQt5-5.9-5.9.1-cp35.cp36.cp37-abi3-macosx_10_6_intel.whl 
(82.2MB)
    100% |████████████████████████████████| 82.2MB 17kB/s 
Collecting sip<4.20,>=4.19.3 (from PyQt5)
  Downloading sip-4.19.3-cp36-cp36m-macosx_10_6_intel.whl (49kB)
    100% |████████████████████████████████| 51kB 1.2MB/s 
Installing collected packages: sip, PyQt5
Successfully installed PyQt5-5.9 sip-4.19.3

You see: Such a wheel is re-used for CPython 3.5, 3.6 and 3.7.

Old remark, but see below: PySide2 is not as far, but we will build similar wheels when we have the first version ready.

Added on 2017/09/25: You can of course also use

pip3 install PyQt5

But at that time my pip/pip2/pip3 was a bit messy linked, so the first solution is rock solid and avoids confusion.

Also right is that you don't always get the lastest version of PyQt5 this way. But for getting started, the priority is to get results quickly and not the bleeding edge.

Update: PySide2 now officially has wheels, to:

$ python3 -m pip install PySide2
Collecting pyside2
  Downloading https://files.pythonhosted.org/packages/2a/e2/2dc134a5c475f661d5ff2ab587fbd2c285db3d064e03ac9b4a2ee0958400/PySide2-5.12.2-5.12.2-cp35.cp36.cp37-abi3-macosx_10_12_intel.whl (109.8MB)
    100% |████████████████████████████████| 109.8MB 238kB/s 
Collecting shiboken2==5.12.2 (from pyside2)
  Downloading https://files.pythonhosted.org/packages/bd/8b/a2ad76c3a935fae51f0ed9b150a9df08167c4550fcd07637f0db19c31849/shiboken2-5.12.2-5.12.2-cp35.cp36.cp37-abi3-macosx_10_12_intel.whl (691kB)
    100% |████████████████████████████████| 696kB 1.6MB/s 
Installing collected packages: shiboken2, pyside2
Successfully installed pyside2-5.12.2 shiboken2-5.12.2

If you see bugs or differences between the two, please feel free to open a bug report. Follow the instructions on https://wiki.qt.io/Qt_for_Python/Reporting_Bugs


You need to install SIP first, which is not just running configure.py:

>>> cd ~/Downloads/sip-4.17
>>> python configure.py
>>> make
>>> make install

Then you can install PyQt5:

>>> cd ~/Downloads/PyQt-gpl-5.5.1
>>> python configure.py --qmake /Users/name/Qt/5.5/clang_64/bin/qmake
>>> make
>>> make install

Qt is set of cross-platform C++ libraries that implement high-level APIs for accessing many aspects of modern desktop and mobile systems. These include location and positioning services, multimedia, NFC and Bluetooth connectivity, a Chromium based web browser, as well as traditional UI development.

PyQt5 is a comprehensive set of Python bindings for Qt v5. It is implemented as more than 35 extension modules and enables Python to be used as an alternative application development language to C++ on all supported platforms including iOS and Android.

PyQt5 may also be embedded in C++ based applications to allow users of those applications to configure or enhance the functionality of those applications.

     brew install PyQt5 (or) pip3 install PyQt5