I was hoping to install pyqt5 on my M1 mac without Rosetta. I was using it as a dependency of another project that I wanted to install in a venv which requires pyqt5 and was not installable via pipx (urh
).
Unfortunately, there currently are no compatible wheels (curl --silent "https://pypi.org/pypi/PyQt5/json" | grep -i arm64
), and attempting to install on 3.10 fails with AttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel'
Thankfully, the homebrew installation of pyqt5 is compiled for arm64 and works well.
My steps were:
$ # Install pyqt5 via homebrew
$ brew install pyqt@5
$ # Note that it's installed in python3.9, not 3.10
$ brew cat pyqt@5 | grep 'depends_on.*python'
depends_on "[email protected]"
$ # Make a python3.9 virtualenv with access to the system's site-packages
$ /opt/homebrew/bin/python3.9 -m venv --system-site-packages .venv
$ source .venv/bin/activate
At this point I was able to install urh
into the virtualenv, using the arm64-compiled pyqt5 from hombrew, without neededing Rosetta (and without needing to further "pollute" my system site-packages), and it runs as expected (since the question was about running).