Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install PyQt5 on M1 arm64 architecture?

I have an M1 mac, but I've noticed that whenever native python is running any automation script (like PyAutoGui) it progressively gets slower and slower, almost as if it's being throttled.

I created an environment with Miniforge3 that is able to utilise Apple's Silicon Chip, making the script run far quicker and more consistently as if it was running on an Intel mac, but I am struggling to install PyQt5 under the Miniforge3 environment, this seems to be an issue people are having, I suspect it's because the module hasn't been ported for arm64.

So I was wondering, is it possible for PyQt5 to run outside the environment, but the actual threads or functions of the application run inside the Miniforge3 environment that is running direction the M1 chip?

Or, is it possible to install PyQt5 on Miniforge3 running on Arm64 architecture?

I've exhausted all options for installing PyQt5.

like image 714
Giuseppe Marziano Avatar asked Oct 18 '25 11:10

Giuseppe Marziano


1 Answers

This is a temporary solution as there does not seem to be any macos-arm64 build of PyQt5 available in the miniforge repositories just yet.

What I did is this:

arch -arm64 brew install pyqt@5
cd /Users/<myusername>/miniforge3/envs/<myenv>/lib/python3.9/site-packages
ln -s /opt/homebrew/Cellar/pyqt@5/5.15.6/lib/python3.9/site-packages/PyQt5 .

This is a very dirty workaround that installs PyQt5 built for the arm64 architecture system-wide and then symlinks it into the miniforge environment.

It will break as soon as the PyQt5 version will change due to upgrade.

I have nothing better than that for the moment, sadly...

like image 53
valentin Avatar answered Oct 20 '25 00:10

valentin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!