Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I run Python 3.9.1 natively on M1 Mac?

Seems to be impossible currently with Anaconda as well as with Xcode 12. Via idle, it runs via Rosetta. There seems to be no discussion of this so either I'm quite naive or maybe this will be useful to others as well.

Python says: "As of 3.9.1, Python now fully supports building and running on macOS 11.0 (Big Sur) and on Apple Silicon Macs (based on the ARM64 architecture). A new universal build variant, universal2, is now available to natively support both ARM64 and Intel 64 in one set of executables" https://docs.python.org/3/whatsnew/3.9.html

Please help a newbie figure out how to take advantage of his recent impulse-buy.

like image 633
hithisispeter Avatar asked Jan 04 '21 08:01

hithisispeter


People also ask

Can I run Python on M1 Macs?

Note: The approaches mentioned in this guide won’t help you run Python natively on the M1 Macs but through Rosetta2. Python will work fine, just keep in mind that people see a 20–30% performance penalty when running x86–64 programs with Rosetta2 compared to native ARM64 1. Setting up Python and Data Science Packages with Anaconda 2.

What versions of Python are supported by macOS 11 Big Sur?

Python maintainers have released 3.9.1 Python, which is the first version to support macOS 11 Big Sur. As they note, Xcode 11 makes it possible to build Universal 2 binaries that work on Apple Silicon. This installer can be deployed back to older versions, tested down to OS X 10.9.

Does Python work on Macs?

Enumerating the changes in the detailed release notes, the developers write that “As of 3.9.1, Python now fully supports building and running on macOS 11.0 (Big Sur) and on Apple Silicon Macs (based on the ARM64 architecture).”

What is the best way to install Python on M1 arm?

You can now install python 3.9.1 through multiple pathways now but the most comprehensive build environment for the full data-science suite for python at the moment (Feb 2021) on M1 ARM architecture is via miniforge. brew install --cask miniforge conda init zsh conda activate conda install numpy scipy scikit-learn Thanks for your reply.


1 Answers

You can now install python 3.9.1 through multiple pathways now but the most comprehensive build environment for the full data-science suite for python at the moment (Feb 2021) on M1 ARM architecture is via miniforge.

e.g.

brew install --cask miniforge
conda init zsh
conda activate
conda install numpy scipy scikit-learn
like image 166
climatebrad Avatar answered Oct 28 '22 16:10

climatebrad