Using PyQt5 on the M1 Mac is not a Problem. There are many guides that describe how to run scripts in the Rosetta Terminal. But can you somehow combine this Feature with Visual Studio Codes Jupyter extension? I can successfully use PyQt5 in the Rosetta terminal, but when I run Jupiter Notebooks (*.ipynb files), the code will return an Error:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last) /var/folders/bh/k5kj66jn2cdby4ln1b3hgmvh0000gn/T/ipykernel_73131/2609138369.py in <module>
----> 1 from PyQt5.QtWidgets import QApplication, QLabel
2 app = QApplication([])
3 label = QLabel('test')
4 label.show()
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/PyQt5/QtWidgets.abi3.so, 2): no suitable image found. Did find: /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/PyQt5/QtWidgets.abi3.so: mach-o, but wrong architecture /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/PyQt5/QtWidgets.abi3.so: mach-o, but wrong architecture
This happens, because installing PyQt5 via the Rosetta terminal doesn't use the arm64 architecture, which the computer is based on, but the Rosetta i386 architecture.
So is there any way to tell VSCode to run these Notebooks with Rosetta? Or is there another workaround I'm currently not thinking of?