now. when i run it. the error conmes 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
As we've discovered, there are no major differences between PyQt5 and PyQt6. The changes that are there can be easily worked around. If you are new to Python GUI programming with Qt you may find it easier to start with PyQt5 still, but for any new project I'd suggest starting with PyQt6.
After hours of trial and error, I was finally able to solve this. My successful configuration is:
/usr/bin/python3 -m venv env
source env/bin/activate
pip install --upgrade pip
pip install PyQt5
I needed PyQt5 as a dependency for a Python library and this worked for me. See original post here.
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
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