Installing pyqt5 with homebrew just for python2

homebrewpython

I don't have (and do not wish to have) python3 installed. I want to install pyqt5 just for python2.

However every time I try to install pyqt5 with homebrew it keeps downloading python3 and trying to install it

Even using brew install pyqt5 --without-python which I would assume is an option created for this exact purpose, just produces exactly the same behaviour and starts downloading python3.

Any ideas?
Any help would be appreciated!

Best Answer

Ugh, of course after trying to fix this for ages, I find the problem 5 min after posting this question!

For anyone else who runs into this:

The problem was that I didn't have sip, which is a requirement, and sip automatically installs for both versions of python too, and so it was sip trying to install python3. sip has its own version of --without-python, but that didn't get passed to it from the pyqt5 install.

tl;dr - install sip separately first:

brew install sip --without-python
brew install pyqt5 --without-python