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.
- Download Miniforge3-MacOSX-arm64.sh, then
- Run the script, then open another shell
$ bash Miniforge3-MacOSX-arm64.sh
- 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
- To compile
numpy, first need to installcythonandpybind11:
$ conda install cython pybind11
- Compile
numpyby (Thanks @Marijn's answer) - don't useconda install!
$ pip install --no-binary :all: --no-use-pep517 numpy
- 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
- 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 bybrew install openblas. Then add[openblas]path/opt/homebrew/opt/openblastosite.cfgand build Numpy from source. M1andi9–9880Hin this post.- My old
i5-6360U2cores on MacBook Pro 2016 13in.
2. Benchmarks:
Here I use two benchmarks:
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')
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 OverflowUpdate 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.
- Download Miniforge3-MacOSX-arm64.sh, then
- Run the script, then open another shell
$ bash Miniforge3-MacOSX-arm64.sh
- 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
- To compile
numpy, first need to installcythonandpybind11:
$ conda install cython pybind11
- Compile
numpyby (Thanks @Marijn's answer) - don't useconda install!
$ pip install --no-binary :all: --no-use-pep517 numpy
- 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
- 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 bybrew install openblas. Then add[openblas]path/opt/homebrew/opt/openblastosite.cfgand build Numpy from source. M1andi9–9880Hin this post.- My old
i5-6360U2cores on MacBook Pro 2016 13in.
2. Benchmarks:
Here I use two benchmarks:
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')
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 |
+-------+-----------+------------+-------------+-----------+--------------------+----+----------+----------+
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.
Anybody tested scientific computing (python especially) performance of the new macs?
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.compandas - Macbook m1 and python libraries - Stack Overflow
[D] Current situation about M1 support of python libraries ?
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?
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?
I can't vouch for this site, but it could be useful:
https://doesitarm.com/formula/numpy/
Python provides Universal builds for M1 support. However within your other requirements, it seems that only TensorFlow has a M1 compatible build at this time. I don't see any compatibility with Rosetta2 on https://isapplesiliconready.com/. So it looks like you'll have to wait until these are updated.
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?