Question: Now. When I run it. The error comes

> 
> ImportError:
> dlopen(/Users/v/Library/Python/3.8/lib/python/site-packages/PyQt5/QtWidgets.abi3.so,
> 2): no suitable image found. Did find:
> /Users/v/Library/Python/3.8/lib/python/site-packages/PyQt5/QtWidgets.abi3.so:
> mach-o, but wrong architecture
> /Users/v/Library/Python/3.8/lib/python/site-packages/PyQt5/QtWidgets.abi3.so:
> mach-o, but wrong architecture
> 
> 
>

Answer: 
I needed PyQt5 as a dependency for a Python library and this worked for me. See original post [here](https://www.zhihu.com/question/437075754/answer/1993415429).

```
brew install pyqt5
echo 'export PATH="/opt/homebrew/opt/qt@5/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/opt/homebrew/opt/pyqt@5/5.15.4_1/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

```
What I ended up doing specifically for `pyqt5` was:

```bash
brew install pyqt@5

```

I think for versions 4 and 6 this may work as well. When I went simply `brew install pyqt` that didn't work unfortunately.

*note this is M1 Macbook only*

One other thing to try as things settle down with M1s is to try `pip3 install pyqt5` in a terminal launched in Rosetta mode (left click -> Get Info -> Open in Rosetta)

**Edit (Nov 2022)**

It seems that if you don't specifically need pyqt5, pyqt6 is now easily installable via pip on M1/M2 Macs.

```bash
python -m pip install pyqt6

```