homebrew - 在 M1 Mac 上找不到 PyTables 的 HDF5 安装

标签 homebrew hdf5 pytables

在 M1 Mac、macOS Monterey 12.4Python 3.10.3

上运行

pip 安装表

Collecting tables
  Using cached tables-3.7.0.tar.gz (8.2 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
  ╰─> [12 lines of output]
      /var/folders/6g/9c7g_2tx2sb7lp8ttwtfky640000gn/T/H5closew_79lujq.c:2:5: error: implicit declaration of function 'H5close' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
          H5close();
          ^
      1 error generated.
      cpuinfo failed, assuming no CPU features: No module named 'cpuinfo'
      * Using Python 3.10.3 (v3.10.3:a342a49189, Mar 16 2022, 09:34:18) [Clang 13.0.0 (clang-1300.0.29.30)]
      * Found cython 0.29.30
      * USE_PKGCONFIG: False
      .. 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.

tried the following来自这个 GitHub 问题:

pip install cython
brew install hdf5
brew install c-blosc
export HDF5_DIR=/usr/local/
export BLOSC_DIR=/usr/local/
pip install tables

但是还是报同样的错误。不确定是不是因为 Homebrew 在 M1 Mac 上使用了不同的路径?

最佳答案

问题是 Homebrew 将文件放在 opt/homebrew/opt/

这为我解决了问题:

export HDF5_DIR=/opt/homebrew/opt/hdf5 
export BLOSC_DIR=/opt/homebrew/opt/c-blosc

关于homebrew - 在 M1 Mac 上找不到 PyTables 的 HDF5 安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73029883/

相关文章:

ssl - 更新 Erlang 后从 SSL 混合 local.hex 失败

macos - 是否可以通过指定语义版本通过Homebrew在Mac OS X上安装golang?

python - 如何使用 python 将 Hdf5 文件部分复制到保持相同结构的新文件中?

python - 使用 HDFStore 文件的线程和异常安全方式

macos - "Closed pull requests"在 `brew search` 的输出中是什么意思?

python - 我无法使用 Homebrew 软件安装 python,因为没有可用的瓶子

python - Pandas 不修改默认的 hdf 格式

python - HDF5 min_itemsize 错误 : ValueError: Trying to store a string with len [##] in [y] column but this column has a limit of [##]!

python - 当结果很大时,在 pytable 中使用索引搜索比不使用索引要慢

python - Pytables 检查列是否存在