installation TensorFlow hour,encounter a dependency h5py,This package could not be successfully installed anyway,Error no information available:
1 |
ERROR: Could not build wheels for h5py, which is required to install pyproject.toml-based projects |
it's hard to do,Check the log and find that there is no binary package for m1,compiled automatically。But the compiler reported that the header file could not be found:
1 2 3 4 5 |
./h5py/api_compat.h:27:10: fatal error: 'hdf5.h' file not found #include "hdf5.h" ^~~~~~~~ 1 error generated. error: command '/usr/bin/clang' failed with exit code 1 |
So use brew to install the missing library,under search,Really have: brew install hdf5 ,Execute again after installation h5py installation,Still the same error,Obviously still can't find it。
use the command find /opt -iname "*hdf5.h*" Find,should be able to find /opt/homebrew/include/hdf5.h this path,Add the relevant environment variables using the following command:
1 2 |
export CPATH="/opt/homebrew/include/" export HDF5_DIR=/opt/homebrew/ |
Execute the command again to install h5py: python3 -m pip install h5py
Finally installed successfully。
Original article written by LogStudio:R0uter's Blog » macOS M1 Pro install h5py
Reproduced Please keep the source and description link:https://www.logcg.com/archives/3548.html
Sorry I fixed this problem but now my issue is no more this error message. Now when I type the command find /opt -iname “*hdf5.h*”
I don’t have anything in return on my terminal. Just a new (base)MacBook-Pro….line to enter a new command
hi,
thanks for your help. I managed to install hdf5 with hombres but when I try running the command Find /opt -iname “*hdf5.h*”
I get this message find: /opt/cisco/anyconnect/temp/downloader: Permission denied
I don’t understand. I try doing it from other internet connection, and doing it while deactivating the Cisco VPN (also I don’t have Cisco app) but nothing seems to work.
Do you have any suggestion ?
Thank you
try prefix ur cmd with sudo
you need to run ‘brew install hdf5’ first
Iam getting this error after executing the cammand :
Error: Cannot install under Rosetta 2 in ARM default prefix (/opt/homebrew)!
To rerun under ARM use:
arch -arm64 brew install …
To install under x86_64, install Homebrew into /usr/local.
Upon trying the command again:
ERROR: Failed building wheel for h5py
Failed to build h5py
ERROR: Could not build wheels for h5py, which is required to install pyproject.toml-based projects
make sure ur terminal running on arm mode instead of Rosetta. And delete the Homebrew thing under /usr/local, arm version of brew installed at /opt/homebrew
I think u need to clean out your env path settings, the intel env confusing them.
that helped, thanks!
I did as you instructed but, still get:
ERROR: Could not build wheels for h5py, which is required to install pyproject.toml-based projects
The above error is generated after running this command for the second time: python3 -m pip install h5py
Did you try find /opt -iname "*hdf5.h*"
see if there any results like /opt/homebrew/include/hdf5.h
the main theory is h5py requiring hdf5, but it cant build itself, we have to install the library manually, then install h5py.
You saved my ass!