問題
使いたいpythonモジュールでhdf5が必要だった。
brew install hdf5@1.8
export HDF5_DIR=/opt/homebrew/Cellar/hdf5@1.8/1.8.22_2
で指定してpipするも、以下のようにhdf5の場所がわからないと言われる。
Collecting tables>=3.0 (from ******)
Using cached tables-3.8.0.tar.gz (8.0 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [10 lines of output]
ld: library not found for -lhdf5
clang: error: linker command failed with exit code 1 (use -v to see invocation)
cpuinfo failed, assuming no CPU features: 'flags'
* Using Python 3.9.5 (default, Jan 24 2022, 16:49:12)
* Found cython 0.29.34
* USE_PKGCONFIG: True
.. ERROR:: Could not find a local HDF5 installation.
You may need to explicitly state where your local HDF5 headers and
library can be found by setting the ``HDF5_DIR`` environment
variable or by using the ``--hdf5`` command-line option.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
解決
これが正解だった。
brew install hdf5
export HDF5_DIR="$(brew --prefix hdf5)"
参考リンク