Will Python be able to run on the new Apple machines running with M1 CPUs?

17,810

Yes. Apple Silicon uses an ARM-based instruction set architecture (ISA). All your favorite open source projects have been running on several different ISAs for years. There's nothing x86-specific about Python. Python runs on various flavors of ARM, MIPS, PowerPC, i386, x86-64, and someone somewhere probably maintains ports for several legacy chip ISAs (Intel Itanium? DEC Alpha? Sun SPARC? HP PA-RISC? Motorola 68k? AMD 29k?)

Did you know Raspberry Pi and several other "single board computers" use ARM-based SOCs? So if you've ever run Python under Raspbian on a Raspberry Pi, you were running it on ARM.

Python is used by several parts of macOS. macOS probably wouldn't be able to fully boot and be functional without Python. Python is already included in the Apple Silicon version of macOS Big Sur.

Share:
17,810

Related videos on Youtube

Vedant Mehta
Author by

Vedant Mehta

Updated on September 18, 2022

Comments

  • Vedant Mehta
    Vedant Mehta over 1 year

    I am getting the new Apple MacBook with its ARM processors. I am wondering if Python will be supported on this new line of Macs. If it is not supported yet, then when will it be supported?

    • Giacomo1968
      Giacomo1968 over 3 years
      Apple will be using Rosetta 2 (behind in the scenes in macOS 11 (Big Sur) to handle the running of non-ARM native code. Meaning Intel code will run on ARM systems via Rosetta 2. So all apps should run including development tools. if they didn’t do that, nobody would buy new machines. Otherwise, nobody here can answer your questions about “M1 over Intel i7” since nobody in the world outside of Apple has done real world benchmarks. This all depends. Just wait and see.
    • Spiff
      Spiff over 3 years
      @giacomo1968 The Python interpreter is open source and compiles natively for whatever ISA your system uses. It's not written in x86 assembly or something. There's no need for Rosetta 2 for any open source project that already runs on macOS, since they all just compile natively to ARM.
    • Giacomo1968
      Giacomo1968 over 3 years
      @Spiff Makes sense. But here is a “for example”: If I migrate my current MacBook Air (Early 2020) to a new MacBook Air (Late 2020), I assume all of the installed stuff I have that Homebrew installed for an Intel CPU will just magically become ARM complied code on migration. I assume that I would have to purposefully uninstall Homebrew installed applications and then reinstall them for them to be ARM, correct? I mean Rosetta 2 exists for a reason.
  • Giacomo1968
    Giacomo1968 over 3 years
    Asked in the main question, but will ask here: If I already am using an Intel-based Mac and then migrate to a new Mac that uses ARM CPUs, I assume I need to recompile/reinstall code to see speed benefits and avoid using Rosetta 2, correct? So if I installed a pile of packages via Homebrew, a migration would bring that all to a new system but until I uninstall and reinstall things, those applications will be using Rosetta to run on an M1 (ARM) CPU.
  • Vedant Mehta
    Vedant Mehta over 3 years
    @Spiff Thanks for the answer! One last question: Will nodejs be able to compile on this new processor? Or is it also not x86 specific?
  • Giacomo1968
    Giacomo1968 over 3 years
    @VedantMehta Anything/everything that compiles from source should be able to compile fine on the new M1 CPU Macs. I highly doubt Node.js would somehow not work. That said, if it cannot compile directly into ARM binaries, it can be an Intel-based binary that uses Rosetta 2 to translate Intel machine code to ARM code. The worst issue you deal with in a case like this is the code running slightly slower because it has to run through Rosetta 2. Please read up on Rosetta 2 here: developer.apple.com/documentation/apple_silicon/…