安装 TensorFlow 时,遇到一个依赖 h5py,这个包无论如何无法成功安装,报错无任何可用信息:
1 |
ERROR: Could not build wheels for h5py, which is required to install pyproject.toml-based projects |
这就很难办了,查看日志发现原来是没有针对 m1 的二进制包,自动进行编译了。但编译报错说找不到头文件:
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 |
于是使用 brew 安装缺少的库,搜索之下,还真有[……]