With a tool such as PyInstaller, you can compile your Python code into a binary executables that you can then share or redistribute to other machines. On MacOS, there are 2 architectures to consider: the older Intel based Macs and the ARM based Macs. You can build 2 versions of your app, one for each architecture. But it’s nicer to provide only 1, universal build of your app that can work on either Mac architecture.
The best way to do this is to build “fat” binaries. Those are basically binaries that contain a version for each CPU architecture and during execution time the proper binary will be selected for the platform. This makes it easier for end users to install and run your app, but it does make the build process for the developer a little more complicated.
The general approach to building a universal executable from a Python app on an ARM Mac is as follows:
- ensure Rosetta is installed (“
softwareupdate --install-rosetta“) - ensure Homebrew is installed for both architectures:
- ARM, installs to /opt/homebrew/bin/brew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Intel, installs to /usr/local/bin/brew:
arch --x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- ARM, installs to /opt/homebrew/bin/brew:
- using the corresponding brew (see previous step), install the ARM and Intel versions of Python, or pyenv, depending on how you want to set up your Python environments:
/opt/homebrew/bin/brew installĀ python@3.11arch --x86_64 /usr/local/bin/brew installĀ python@3.11

Now with the environments set up, your build script needs to perform the following steps:
- compile the code with the x86 Python/PyInstaller (or whatever your build process looks like):
arch --x86_64 /usr/local/bin/python3.11 -m venv build/venv_x86_64arch --x86_64 build/venv_x86_64/pip3 install -r requirements.txtarch --x86_64 build/venv_x86_64/pyinstaller
- compile the code with the ARM Python/PyInstaller (or whatever your build process looks like):
arch --arm64 /opt/homebrew/bin/python3.11 -m venv build/venv_arm64arch --arm64 build/venv_arm64/pip3 install -r requirements.txtarch --arm64 build/venv_arm64/pyinstaller
- Use the lipo utility to combine the binaries from both builds together
- bundle everything into a single installer dmg
You can find a more complete build script example here: https://github.com/koen-aerts/potdroneflightparser/blob/v2.4.2/builders/macos/build.sh