Install PyQt on Mac
Installing Python 3 and PyQt5 on Mac OS X with Homebrew.
Homebrew is a package manager for OS X.
It allows to install and manage easily hundreds of “packages” or programs via the command lines.
This method has been tested on OS X Yosemite and works for all versions of OS X.
3 steps are required.
Step 1: installation of XCode
Go to the App Store to download the latest free version of XCode.
Once installed, open the Terminal (located in Applications/Utilities) and enter the following command line:
xcode-select --install
A pop-up should appear asking for confirmation to start the installation. Click Install and complete the installation.
Step 2: installation of Homebrew
Enter the following command line in the Terminal:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Note:
the installation requests several times to validate command lines by pressing on the “Enter” key and even enter the password to run a sudo command.Once the installation is complete, run the “brew doctor” command, which is designed to detect if Homebrew is installed on your system:
brew doctor
Note:
If you get the message /usr/bin occurs before /usr/local/bin, run the following command as recommended on the Homebrew website:
echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bash_profile
The purpose of this command is to move the Brew component to a location on the disk where it will be accessible globally on your computer.
You can then run the Brew command from any path in the command line.
Step 3: installation of Python 3 and PyQt5
- Enter the following command lines in the Terminal:
brew update
brew install python
pip3 install PyQt5 PyQtWebEngine
Last modification of this page: 2022-10-24.