I know this is from a year ago but this may help someone...
Note: This is for PyQT5 and Python 3. It is an alternative to using homebrew.
Background
If you installed Python 3.x, it installs in a separate directory (leaving your Mac version alone). After adding the new directories
to your path, most people can just use python3.5
(or whatever version) to access it without having to change over python
alias.
Also note that Python comes with pip
right out of the box...
Read more on Python 3 for Mac here.
Answer the question already
Now, all that said, you can simply use the following to install via pip:
sudo python3.5 -m pip install PyQt5
You'll likely have to use sudo
. Output should look like:
Collecting PyQt5
Downloading PyQt5-5.7-cp35-cp35m-macosx_10_6_intel.whl (79.4MB)
100% |████████████████████████████████| 79.4MB 18kB/s
Collecting sip (from PyQt5)
Downloading sip-4.18.1-cp35-cp35m-macosx_10_6_intel.whl (46kB)
100% |████████████████████████████████| 51kB 9.8MB/s
Installing collected packages: sip, PyQt5
Successfully installed PyQt5-5.7 sip-4.18.1
Don't forget to use the -m
option. It allows for library modules to be run as scripts. From the --help
entry:
-m mod : run library module as a script (terminates option list)
Note: Older versions of PyQT cannot be installed via pip.