Failed to build h5py on mac M1

We Are Going To Discuss About Failed to build h5py on mac M1. So lets Start this Python Article.

Failed to build h5py on mac M1

  1. How to solved Failed to build h5py on mac M1

    You will need to export the HDF5_DIR environment variable first.
    Run:
    $ export HDF5_DIR=/opt/homebrew/Cellar/hdf5/1.12.1/ $ pip install --no-binary=h5py h5py

  2. Failed to build h5py on mac M1

    You will need to export the HDF5_DIR environment variable first.
    Run:
    $ export HDF5_DIR=/opt/homebrew/Cellar/hdf5/1.12.1/ $ pip install --no-binary=h5py h5py

Solution 1

You will need to export the HDF5_DIR environment variable first.

Run:

$ export HDF5_DIR=/opt/homebrew/Cellar/hdf5/1.12.1/
$ pip install --no-binary=h5py h5py

Original Author Bornfree Of This Content

Solution 2

  1. brew install hdf5

  2. Get version number from ls /opt/homebrew/Cellar/hdf5/, mine was 1.13.0

  3. Export that directory so h5py can see it:

    export HDF5_DIR=/opt/homebrew/Cellar/hdf5/[version number]/

    Mine was: export HDF5_DIR=/opt/homebrew/Cellar/hdf5/1.13.0/

  4. Try pip installing again (tensorflow or h5py).

Original Author flicht Of This Content

Solution 3

None of the above answers worked for me, but this did:

brew install hdf5
export CPATH="/opt/homebrew/include/"
export HDF5_DIR=/opt/homebrew/
pip3 install h5py

Original Author John Shahbazian Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

ittutorial team

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment