How to install h5py (needed for Keras) on MacOS with M1? September 25, 2023 by Tarik This works for me: $ brew install hdf5 $ export HDF5_DIR="$(brew --prefix hdf5)" $ pip install --no-binary=h5py h5py