Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I can't install python modules on Apple Silicon

I have macbook air m1 and I can't install python modules like numpy, matplotlib. I install python3.8 with homebrew then install virtaulenv. In venv, when I run 'pip install numpy' the error shows up: '... ERROR: Failed building wheel for numpy Failed to build numpy ERROR: Could not build wheels for numpy which use PEP 517 and cannot be installed directly' I tried 'pip install --upgrade pip setuptools wheel' doesn't work. Please help.

like image 835
Osman Avatar asked Aug 23 '26 22:08

Osman


1 Answers

Install python 3.9.1 from python.org (ARM version) Then, for Numpy: python3 -m pip install cython python3 -m pip install --no-binary :all: --no-use-pep517 numpy==1.20rc1

Then, for matplotlib: brew install libjpeg python3 -m pip install matplotlib

This works for me on a Mac min with Apple Silicon. No luck for SciPy yet, though.

like image 89
David Sénéchal Avatar answered Aug 26 '26 23:08

David Sénéchal