What is the Status of Native ARM-Apple Silicon Python Versions?

Hunting around I can’t seem to discern what the state of Apple Silicon native python is. I gather that MiniForge is working on this (but I have no intention of ever using anything Conda-related again).

I would like to install some native python versions if that is even possible at this point, ideally using Pyenv to easily switch between x86 and arm versions.

Can anyone explain if:

a) There are any python repositories that offer Apple Silicon (ARM) native python versions? (I could swear that I had an arm version of python installed some time ago but can’t seem to replicate it.) I want a python install where if I run: “import platform; platform.machine()” then I get arm64 as a result.

b) If there are, then what the best practices process for installing such a python version would be?

The macOS installers on www.python.org are “Universal 2” builds, which means they support both x86-64 and arm64 natively.

AFAIK homebrew and macports also support arm64 natively.

2 Likes

I think that any default installation onto an Apple Silicon Mac would automatically give you the native build. This is certainly true for homebrew or python.org.

I both build from source and use a Conda version of 3.11 on my M1 Mac with no issues.

Thanks for the replies!

This topic will probably morph into part (b) then: What is the protocol for ensuring that you get a native-arm build of a python version. I think I was able to do this once in the past but can’t seem to replicate it. My Pyenv installs are all giving me x86 builds now, despite using this command, e.g.:

arch -arm64 pyenv install 3.11.7

I have two Homebrew installations, one for x86 which I call with an alias to 'brew86", and the default installation for the arm version of brew.

Maybe there is some x86 library that pyenv depends up that is x86, which triggers an x86 version of python to be installed–??

Just checked. Hombrew is arm (I think), openssl 3 is arm, and readline 8.2 is arm. I wonder why I’m getting an x86 install–??

SOLVED: I am now able to install arm versions of python and x86 versions separately through separate shells (I use bash for x86 and zsh for arm), separate Homebrew installs, and separate Pyenv installs. Somehow, my arm pyenv calls were entangling x86 compiles which was fixed after I deleted x86 Homebrew and reinstalled it. The second trick is deleting the openssl and readline formulae from the x86 Homebrew so x86 pyenv calls are forced to download them. More details if anyone happens to want them.