Update Mar 28 2022: Please see @AndrejHribernik's comment below.


How to install numpy on M1 Max, with the most accelerated performance (Apple's vecLib)? Here's the answer as of Dec 6 2021.


Steps

I. Install miniforge

So that your Python is run natively on arm64, not translated via Rosseta.

  1. Download Miniforge3-MacOSX-arm64.sh, then
  2. Run the script, then open another shell
$ bash Miniforge3-MacOSX-arm64.sh
  1. Create an environment (here I use name np_veclib)
$ conda create -n np_veclib python=3.9
$ conda activate np_veclib

II. Install Numpy with BLAS interface specified as vecLib

  1. To compile numpy, first need to install cython and pybind11:
$ conda install cython pybind11
  1. Compile numpy by (Thanks @Marijn's answer) - don't use conda install!
$ pip install --no-binary :all: --no-use-pep517 numpy
  1. An alternative of 2. is to build from source
$ git clone https://github.com/numpy/numpy
$ cd numpy
$ cp site.cfg.example site.cfg
$ nano site.cfg

Edit the copied site.cfg: add the following lines:

[accelerate]
libraries = Accelerate, vecLib

Then build and install:

$ NPY_LAPACK_ORDER=accelerate python setup.py build
$ python setup.py install
  1. After either 2 or 3, now test whether numpy is using vecLib:
>>> import numpy
>>> numpy.show_config()

Then, info like /System/Library/Frameworks/vecLib.framework/Headers should be printed.

III. For further installing other packages using conda

Make conda recognize packages installed by pip

conda config --set pip_interop_enabled true

This must be done, otherwise if e.g. conda install pandas, then numpy will be in The following packages will be installed list and installed again. But the new installed one is from conda-forge channel and is slow.


Comparisons to other installations:

1. Competitors:

Except for the above optimal one, I also tried several other installations

  • A. np_default: conda create -n np_default python=3.9 numpy
  • B. np_openblas: conda create -n np_openblas python=3.9 numpy blas=*=*openblas*
  • C. np_netlib: conda create -n np_netlib python=3.9 numpy blas=*=*netlib*

The above ABC options are directly installed from conda-forge channel. numpy.show_config() will show identical results. To see the difference, examine by conda list - e.g. openblas packages are installed in B. Note that mkl or blis is not supported on arm64.

  • D. np_openblas_source: First install openblas by brew install openblas. Then add [openblas] path /opt/homebrew/opt/openblas to site.cfg and build Numpy from source.
  • M1 and i9–9880H in this post.
  • My old i5-6360U 2cores on MacBook Pro 2016 13in.

2. Benchmarks:

Here I use two benchmarks:

  1. mysvd.py: My SVD decomposition
import time
import numpy as np
np.random.seed(42)
a = np.random.uniform(size=(300, 300))
runtimes = 10

timecosts = []
for _ in range(runtimes):
    s_time = time.time()
    for i in range(100):
        a += 1
        np.linalg.svd(a)
    timecosts.append(time.time() - s_time)

print(f'mean of {runtimes} runs: {np.mean(timecosts):.5f}s')
  1. dario.py: A benchmark script by Dario Radečić at the post above.

3. Results:

+-------+-----------+------------+-------------+-----------+--------------------+----+----------+----------+
|  sec  | np_veclib | np_default | np_openblas | np_netlib | np_openblas_source | M1 | i9–9880H | i5-6360U |
+-------+-----------+------------+-------------+-----------+--------------------+----+----------+----------+
| mysvd |  1.02300  |   4.29386  |   4.13854   |  4.75812  |      12.57879      |  / |     /    |  2.39917 |
+-------+-----------+------------+-------------+-----------+--------------------+----+----------+----------+
| dario |     21    |     41     |      39     |    323    |         40         | 33 |    23    |    78    |
+-------+-----------+------------+-------------+-----------+--------------------+----+----------+----------+
Answer from graphitump on Stack Overflow
🌐
Apple Developer
developer.apple.com › forums › thread › 695963
Why Python native on M1 Max is gre… | Apple Developer Forums
January 30, 2023 - On M1 Max, why run in PyCharm IDE is constantly slower ~20% than run from terminal, which doesn't happen on my old Intel Mac. ... Miniforge-arm64, so that python is natively run on M1 Max Chip.
Top answer
1 of 6
18

Update Mar 28 2022: Please see @AndrejHribernik's comment below.


How to install numpy on M1 Max, with the most accelerated performance (Apple's vecLib)? Here's the answer as of Dec 6 2021.


Steps

I. Install miniforge

So that your Python is run natively on arm64, not translated via Rosseta.

  1. Download Miniforge3-MacOSX-arm64.sh, then
  2. Run the script, then open another shell
$ bash Miniforge3-MacOSX-arm64.sh
  1. Create an environment (here I use name np_veclib)
$ conda create -n np_veclib python=3.9
$ conda activate np_veclib

II. Install Numpy with BLAS interface specified as vecLib

  1. To compile numpy, first need to install cython and pybind11:
$ conda install cython pybind11
  1. Compile numpy by (Thanks @Marijn's answer) - don't use conda install!
$ pip install --no-binary :all: --no-use-pep517 numpy
  1. An alternative of 2. is to build from source
$ git clone https://github.com/numpy/numpy
$ cd numpy
$ cp site.cfg.example site.cfg
$ nano site.cfg

Edit the copied site.cfg: add the following lines:

[accelerate]
libraries = Accelerate, vecLib

Then build and install:

$ NPY_LAPACK_ORDER=accelerate python setup.py build
$ python setup.py install
  1. After either 2 or 3, now test whether numpy is using vecLib:
>>> import numpy
>>> numpy.show_config()

Then, info like /System/Library/Frameworks/vecLib.framework/Headers should be printed.

III. For further installing other packages using conda

Make conda recognize packages installed by pip

conda config --set pip_interop_enabled true

This must be done, otherwise if e.g. conda install pandas, then numpy will be in The following packages will be installed list and installed again. But the new installed one is from conda-forge channel and is slow.


Comparisons to other installations:

1. Competitors:

Except for the above optimal one, I also tried several other installations

  • A. np_default: conda create -n np_default python=3.9 numpy
  • B. np_openblas: conda create -n np_openblas python=3.9 numpy blas=*=*openblas*
  • C. np_netlib: conda create -n np_netlib python=3.9 numpy blas=*=*netlib*

The above ABC options are directly installed from conda-forge channel. numpy.show_config() will show identical results. To see the difference, examine by conda list - e.g. openblas packages are installed in B. Note that mkl or blis is not supported on arm64.

  • D. np_openblas_source: First install openblas by brew install openblas. Then add [openblas] path /opt/homebrew/opt/openblas to site.cfg and build Numpy from source.
  • M1 and i9–9880H in this post.
  • My old i5-6360U 2cores on MacBook Pro 2016 13in.

2. Benchmarks:

Here I use two benchmarks:

  1. mysvd.py: My SVD decomposition
import time
import numpy as np
np.random.seed(42)
a = np.random.uniform(size=(300, 300))
runtimes = 10

timecosts = []
for _ in range(runtimes):
    s_time = time.time()
    for i in range(100):
        a += 1
        np.linalg.svd(a)
    timecosts.append(time.time() - s_time)

print(f'mean of {runtimes} runs: {np.mean(timecosts):.5f}s')
  1. dario.py: A benchmark script by Dario Radečić at the post above.

3. Results:

+-------+-----------+------------+-------------+-----------+--------------------+----+----------+----------+
|  sec  | np_veclib | np_default | np_openblas | np_netlib | np_openblas_source | M1 | i9–9880H | i5-6360U |
+-------+-----------+------------+-------------+-----------+--------------------+----+----------+----------+
| mysvd |  1.02300  |   4.29386  |   4.13854   |  4.75812  |      12.57879      |  / |     /    |  2.39917 |
+-------+-----------+------------+-------------+-----------+--------------------+----+----------+----------+
| dario |     21    |     41     |      39     |    323    |         40         | 33 |    23    |    78    |
+-------+-----------+------------+-------------+-----------+--------------------+----+----------+----------+
2 of 6
15

Possible Cause: Different BLAS Libraries

Since the benchmark is running linear algebra routines, what is likely being tested here are the BLAS implementations. A default Anaconda distribution for osx-64 platform is going to come with Intel's MKL implementation; the osx-arm64 platform only had the generic Netlib BLAS and the OpenBLAS implementation options when this question was first asked.

I get the following benchmark results (updated July 2025):

macOS Intel Core i9 (x86_64)

BLAS Implmentation Mean Timing (s)
mkl 0.95932
blis 1.72059
openblas 2.17023
accelerate 2.56365
netlib 5.72782

macOS M1 4P/4E (arm64)

BLAS Implmentation Mean Timing (s)
accelerate (macOS 13.3) 0.98718
accelerate (macOS 13.2) 1.03141
netlib 4.36523
openblas 10.33956

macOS M3 Pro 5P/6E (arm64)

BLAS Implmentation Mean Timing (s)
accelerate (macOS 15.5) 0.70022
newaccelerate (macOS 15.5) 0.71861
openblas 1.77481
netlib 3.60865

macOS M3 Max 12P/4E (arm64)

BLAS Implmentation Mean Timing (s)
accelerate (macOS 14.5) 0.71095
netlib 3.57532
openblas 5.05429

So, I suspect the old MBP had MKL installed, while the M1 system in OP is installing either Netlib or OpenBLAS. Apple Silicon users should identify which library runs fastest on their system. The consensus appears to be that for M1/M2/M3 systems, Apple's Accelerate library is the most performant.

It should be noted that Accelerate implementation was significantly updated in macOS 13.3 and this seems to provide a slight performance boost (~5%). In July 2025, Conda Forge released an expanded interface based on the 13.3 update, which now goes by the build name newaccelerate.

Hence, M1/M2/M3 users should consider including the requirement:

'blas=*=accelerate'

or

'blas=*=newaccelerate'

when creating Conda environments.


Specifying BLAS Implementation

Here are specifically the different environments I tested:

## Note that `conda-forge` channel is prioritized on my system
## also, `mamba` is a faster version of `conda`

# MKL
mamba create -n np_mkl python=3.9 numpy 'blas=*=mkl'

# BLIS
mamba create -n np_blis python=3.9 numpy 'blas=*=blis'

# OpenBLAS
mamba create -n np_openblas python=3.9 numpy 'blas=*=openblas'

# Accelerate
mamba create -n np_accelerate python=3.9 numpy 'blas=*=accelerate'

# New Accelerate
mamba create -n np_newaccelerate python=3.9 numpy 'blas=*=newaccelerate'

# Netlib
mamba create -n np_netlib python=3.9 numpy 'blas=*=netlib'

and ran the benchmark script (so-np-bench.py) with

conda run -n np_mkl python so-np-bench.py

# etc.

Possible caveats with using Accelerate

Note that there has been incompatibility between SciPy and Accelerate due to the LAPACK implementation in Accelerate being old. However, it has been updated in macOS 13.3, which may resolve such issues. See this thread for details.

Technically, the full new interface is provided in Conda Forge as the build newaccelerate. Initial testing shows it provides comparable performance as the accelerate interface but may be enable some of the compatibility issues to be resolved.


Emulation Mode (Rosetta)

Sometimes one may have to create an environment in emulation mode, e.g., need a package that doesn't have an osx-arm64 build yet. Here's the benchmarking (as of July 2023) using forced osx-64 on an M1:

macOS M1 4P/4E (arm64 with osx-64 subdir)

BLAS Implmentation Mean Timing (s)
accelerate 1.71188
blis 2.41957
netlib 3.92932
openblas 5.98487
mkl n/a (cannot emulate)

These runs use the same creation commands as osx-64 above, but with CONDA_SUBDIR=osx-64.

Important Note: Up through May 2024, the openblas runs on M1/M3 used all cores, but to no apparent benefit. So I had strongly recommended avoiding it as a serious waste of energy. However, running the benchmark on an M3 Pro in July 2025 shows a vast improvement in the openblas performance. It is possible there was a bug fix in the interim. Still, accelerate yields consistently better performance.

Takeaway: if you are on an Apple Silicon machine, use 'blas=*=accelerate' whether or not you are emulating. However, the native environment seems to be the fastest option.

Discussions

Anybody tested scientific computing (python especially) performance of the new macs?
https://youtu.be/W6HU1mwvw2M Found this earlier. Helped me out hope it helps you More on reddit.com
🌐 r/macbookpro
19
5
October 28, 2021
Current situation about M1 support of python libraries ?

I can't vouch for this site, but it could be useful:

https://doesitarm.com/formula/numpy/

More on reddit.com
🌐 r/mac
3
4
September 20, 2021
pandas - Macbook m1 and python libraries - Stack Overflow
The current generation M1 has a maximum of 16 Gb of RAM. More on stackoverflow.com
🌐 stackoverflow.com
December 6, 2021
[D] Current situation about M1 support of python libraries ?
If you're going to be doing any local ML you really want an x86 CPU and an Nvidia GPU. It will save you so much headache and pain. If you're going to be just doing remote stuff (ssh and remote development + code review etc) then it's probably fine. More on reddit.com
🌐 r/MachineLearning
58
105
September 20, 2021
🌐
Medium
medium.com › @balass › installing-python-and-jupyter-on-apple-m1-max-chip-d9b17e053885
Installing Python and Jupyter on Apple M1 Max Chip | by Bala Sivasubramanian | Medium
August 9, 2023 - How to Install Pyenv and JupyterLab on macOS M1 Max Architecture · Pyenv is a tool that allows you to easily manage multiple versions of Python on your system.
🌐
Towards Data Science
towardsdatascience.com › home › latest › apple’s new m1 pro and m1 max macbooks
Apple's new M1 Pro and M1 Max MacBooks | Towards Data Science
March 5, 2025 - Yes, the M1 chip is fast and energy-efficient. But frequently, it’s a hassle to install python packages from pip.
🌐
YouTube
youtube.com › alex ziskind
python environment setup on Apple Silicon | M1, M1 Pro/Max with Conda-forge - YouTube
Here I show how to get set up with a Python environment on Apple Silicon machines; M1, M1 Pro, and M1 Max as of right now. I recommend using conda forge to b...
Published: November 26, 2021
Views: 81K
🌐
GitHub
github.com › tlkh › m1-cpu-benchmarks
GitHub - tlkh/m1-cpu-benchmarks
M1 Max is about 70% faster in executing Python code compared to 5600X, according to the PyPerformance benchmark. In many subtasks, M1 finishes in almost half the time.
Starred by 54 users
Forked by 10 users
Languages: Jupyter Notebook 97.7% | Python 2.3% | Jupyter Notebook 97.7% | Python 2.3%
🌐
YouTube
youtube.com › watch
M1 Max vs Intel Core i9 Python Race | XPS 15 2022 - YouTube
Apple M1 Max MacBook Pro vs Dell XPS 15 with Intel Core i9 12900KF in a Python implementation of the Mandlebrot algorithm.Monitor fans and temp on Mac: https...
Published: June 29, 2022
Find elsewhere
🌐
Towards Data Science
towardsdatascience.com › home › latest › setting up apple’s m1 macbooks for machine learning
Setting up Apple's M1 MacBooks for Machine Learning | Towards Data Science
March 5, 2025 - Anaconda and venv (included with python) are the most frequently used tools to handle this. In this article, I’ll use Anaconda, or more specifically, the conda utilities. I do this because installing TensorFlow on the M1 MacBooks currently requires the conda tools for smooth installation.
🌐
YouTube
youtube.com › watch
Run Python FASTER | M1 Max, M2, M2 Pro, and M2 Max - YouTube
Apple M1 Max vs M2 vs M2 Pro vs M2 Max in single and multi core Python implementations. Let's go!Monitor fans and temp on Mac: https://www.tunabellysoftware....
Published: February 24, 2023
🌐
YouTube
youtube.com › watch
M1 Mac sh*ts its pants with this Python test! (or does it? muhahaha) - YouTube
Apple M1 MacBook vs Intel i9 MacBook in a Python race once again, this time in an extreme single core test sorting many integers. This shows off the code run...
Published: September 7, 2021
🌐
Frank's World
franksworld.com › tag › m1-max-python
m1 max python – Frank's World of Data Science & AI
If you’re envious of the performance of the new M1/M1 Pro chips over the Wintel stack, you’re not alone. I’m posting this video for my own reference, should Santa decide to get me one.
🌐
YouTube
youtube.com › watch
I made Python 2x FASTER on my M1 MacBook - YouTube
In this video I run single and multi core Python tests on the M1 MacBook Air (16GB model). Comparing the Apple Silicon vs Intel processes to run the Python c...
Published: August 31, 2021
🌐
Reddit
reddit.com › r/macbookpro › anybody tested scientific computing (python especially) performance of the new macs?
r/macbookpro on Reddit: Anybody tested scientific computing (python especially) performance of the new macs?
October 28, 2021 -

I’ve a 16 inch 2019 model and on the fence about getting an M1 max mbp. People who got them, did you check how’s performance of python libraries like numpy, scipy, pytorch in general?

Most YouTube benchmarks are from video editors or creative pros so any info from people using these machines for compute tasks would be helpful.

Also if you’re a software dev, care to share your experience so far?

🌐
GitHub
gist.github.com › MarkDana › a9481b8134cf38a556cf23e1e815dafb
Install NumPy on M1 Max - Gist - GitHub
@AlphaMoury I don't think it has anything to do with the m1 processor version. I only did three things, hope this helps you: ... curl -Ls https://micro.mamba.pm/api/micromamba/osx-arm64/latest | tar -xvj bin/micromamba mv bin/micromamba /usr/local/bin/micromamba /usr/local/bin/micromamba shell init -s zsh -p ~/micromamba source ~/.zshrc micromamba activate micromamba install python=3.10 jupyter
🌐
Reddit
reddit.com › r/mac › current situation about m1 support of python libraries ?
r/mac on Reddit: Current situation about M1 support of python libraries ?
September 20, 2021 -

I am a Data Scientist and intended to buy a new M1 macbooks, air or pro, for my data science works but there were a lot of feedbacks which mentions that most of the libraries are not configured for ARM. There are also some people say "M1 is machine learning beast". I am mostly using Pandas, Tensorflow, Scikitlearn, Numpy, Flask and Plotly for my studies.

What are your experiences about the usage of M1 chip with python libraries? Which libraries you use perfectly and which are not supported?

Is it a good idea to buy M1 for Data Science or is it better to wait?

Top answer
1 of 1
45

This GitHub repository has lots of useful information about the Apple M1 chip and data science in Python https://github.com/neurolabusc/AppleSiliconForNeuroimaging. I have included representative quotes below. This repository focuses on software for brain imaging analysis, but the takeaways are broad.

Updated on 27 September 2021.

TL;DR

Unless you are a developer, I would strongly discourage scientists from purchasing an Apple Silicon computer in the short term. Productive work will require core tools to be ported. In the longer term, this architecture could have a profound impact on science. In particular if Apple develops servers that exploit the remarkable power efficiency of their CPUs (competing with AWS Graviton) and leverage the Metal language and GPUs for compute tasks (competing with NVidia's Tesla products and CUDA language).

Limitations facing Apple Silicon

The infrastructure scientists depend on is not yet available for this architecture. Here are some of the short term limitations:

  • Native R can use the unstable R-devel 4.1. However, RStudio will require gdb.
  • Julia does not yet natively support Apple Silicon.
  • Python natively supports Apple Silicon. However, some modules have issues or are slow. See the NiBabel section below.
  • Scientific modules of Python, R, and Julia require a Fortran compiler, which is currently only available in experimental form.
  • While Apple's C Clang compiler generates fast native code, many scientific tools will need to wait until gcc and gFortran compilers are available.
  • Tools like VirtualBox, VMware Fusion, Boot Camp and Parallels do not yet support Apple Silicon. Many users rely on these tools for using Windows and Linux programs on their macOS computers.
  • Docker can support Apple Silicon. However, attempts to run Intel-based containers on Apple Silicon machines can crash as QEMU sometimes fails to run the container. These containers are popular with many neuroimaging tools.
  • Homebrew 3.0 supports Apple Silicon. However, many homebrew components do not support Apple Silicon. MATLAB is used by many scientific tools, including SPM. While Matlab works in translation, it is not yet available natively (and mex files will need to be recompiled).
  • FSL and AFNI do not yet natively support this architecture. While code may work in translation, creating some native tools must wait for compilers and libraries to be updated. This will likely require months.
  • The current generation M1 only has four high performance cores. Most neuroimaging pipelines combine sequential tasks that only require a single core (where the M1 excels) as well as parallel tasks. Those parallel tasks could exploit a CPU with more cores (as shown in the pigz and niimath tests below). Bear in mind that this mixture of serial and parallel code faces Amdahls law, with diminishing returns for extra cores.
  • The current generation M1 has a maximum of 16 Gb of RAM. Neuroimaging datasets often have large memory demands (especially multi-band accelerated functional, resting-state and diffusion datasets).
  • In general, the M1 and Intel-based Macs have identical OpenGL compatibility, with the M1 providing better performance than previous integrated solutions. However, there are corner cases that may break OpenGL tools. Here I describe four limitations. First, OpenGL geometry shaders are not supported (there is no Metal equivalent). Second, the new retina displays support wide color with 16 bitsPerSample that can cause issues for code that assumes 32-bit RGBA textures (such as the text in this Apple example code). Third, textures can be handled differently. Fourth, use of the GL_INT_2_10_10_10_REV data type will cripple performance (tested on macOS 11.2). This is unfortunate, as Apple advocated for this datatype once upon a time. In this case, code msut be changed to use the less compact GL_HALF_FLOAT which is natively supported by the M1 GPU. This impacts neuroimaging scientists visualizing DTI tractography where GPU resources can be overwhelmed.
🌐
Reddit
reddit.com › r/machinelearning › [d] current situation about m1 support of python libraries ?
r/MachineLearning on Reddit: [D] Current situation about M1 support of python libraries ?
September 20, 2021 -

I am a Data Scientist and intended to buy a new M1 macbooks, air or pro, for my data science works but there were a lot of feedbacks which mentions that most of the libraries are not configured for ARM. There are also some people say "M1 is machine learning beast". I am mostly using Pandas, Tensorflow, Scikitlearn, Numpy, Flask and Plotly for my studies.

What are your experiences about the usage of M1 chip with python libraries? Which libraries you use perfectly and which are not supported?

Is it a good idea to buy M1 for Data Science or is it better to wait?

🌐
Daniel Bourke
mrdbourke.com › setup-apple-m1-pro-and-m1-max-for-machine-learning-and-data-science
Setup Apple Mac for Machine Learning with TensorFlow (works for all M1 and M2 chips)
January 18, 2023 - Setup a TensorFlow and machine learning environment on Apple Silicon Macs. Works for M1, M1 Pro, M1 Max, M1 Ultra and M2.
🌐
Frank's World
franksworld.com › tag › python-m1-max
python m1 max – Frank's World of Data Science & AI
If you’re envious of the performance of the new M1/M1 Pro chips over the Wintel stack, you’re not alone. I’m posting this video for my own reference, should Santa decide to get me one.
🌐
Anaconda
anaconda.com › home › blog › a python data scientist’s guide to the apple silicon transition
A Python Data Scientist’s Guide to the Apple Silicon Transition | Anaconda
October 25, 2025 - Maximum of 16 GB of RAM: More memory is always helpful for working with larger datasets, and 16 GB might not be enough for some use cases. Minimal support for the GPU and ANE in the Python data science ecosystem: The tight integration between ...