PyInstaller issues on an M1 Mac
Building stand-alone applications in python on a Mac is easy. Building stand-alone applications in python on an M1 Mac… not so much. The issue lies in pre-compiled bootloaders you get from a standard pip install pyinstaller.
I was recently tasked with building a PyQt/PySide6 application for an M1. The errors were bountiful… and obscure as shit. After days of searching and cursing I figured it out: I needed freshly compiled bootloaders for ARM64.
Building PyInstaller Bootloaders
Clone pyinstaller, cd into the bootloader directory then run ./waf all:
git clone https://github.com/pyinstaller/pyinstaller
cd pyinstaller/bootloader
python3 ./waf all
Ensure you’re in your desired environment (I had issues doing this with Conda). Then while still in pyinstaller/bootloader run:
pip install ..
Return to your project, ensure your pyinstaller build is in your env, and run pyinstaller like usual.
More info: https://pyinstaller.org/en/stable/bootloader-building.html
Fin.