I am trying to install pyqt5 using mac OS with the M1 chip and Python 3.9.12. I suspect the M1 chip may be the cause.
I get an error metadata-generation-failed.
minimum working example
# directly in the terminal
pip install --no-cache-dir PyQt5==5.14.1
or by adding the line below to a requirements.txt
# necessary for jupyter-notebook so added to requirements.txt
# then run: pip install -r requirements.txt
pyqt5==5.14.1 # missing in conda-forge
my attempts
I also tried using the solutions below but non worked. Homebrew also claimed that pyqt was installed which was strange.
pip install pyqt5brew install pyqt5requirements.txt then running pip install -r requirements.txtrelated questions:
This might really be a M1 issue. I think this is a similar issue to yours: How can i run pyqt5 on my mac with M1chip
But it might be a better solution to just build the PyQt5 package from source: Building PyQt5 from Source
I also found this script where someone builds and installs PyQt6 on a M1 Mac: Build PyQt6 on M1. This script can be altered to build PyQt5.
EDIT: Consider using PyQt6 (pip install PyQt6). It already has a universal2 build on pypi.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With