在brew update & 之后HDF5出现问题升级

发布于 2025-01-19 12:31:03 字数 1317 浏览 3 评论 0原文

我是 M1 用户,到目前为止正在使用 python 3.9.10 进行编码。

我尝试更新lib.与自制程序,特别是对于 python 3.9.12 和 HDF5。我还重新安装了h5py。这里我尝试过。

brew update & upgrade
brew reinstall hdf5
export HDF5_DIR=/opt/homebrew/Cellar/hdf5/1.13.0/
pip install h5py --upgrade --no-dependencies --force

全部升级完成。然而我在尝试代码时遇到了这样的错误信息,根据之前的构建环境没有错误。

>     import h5py
>  File "/opt/homebrew/lib/python3.9/site-packages/h5py/__init__.py", line 25, in  <module>
>    from . import _errors
> ImportError: dlopen(/opt/homebrew/lib/python3.9/site-packages/h5py/_errors.cpython-39- darwin.so, 0x0002): Library not loaded: /opt/homebrew/opt/hdf5/lib/libhdf5.300.dylib
>  Referenced from: /opt/homebrew/lib/python3.9/site-packages/h5py/_errors.cpython-39-darwin.so
>  Reason: tried: '/opt/homebrew/opt/hdf5/lib/libhdf5.300.dylib' (no such file), '/usr/local/lib/libhdf5.300.dylib' (no such file), '/usr/lib/libhdf5.300.dylib' (no such file), '/opt/homebrew/Cellar/hdf5/1.12.1_1/lib/libhdf5.300.dylib' (no such file), '/usr/local/lib/libhdf5.300.dylib' (no such file), '/usr/lib/libhdf5.300.dylib' (no such file)

如上所示,在brew升级之后,hdf5_dir被修复在1.12.1_1上,即使我已经安装了1.13.0,直到尝试brew升级时才出现问题。 如果有人知道问题的原因以及如何解决,请帮助我。

提前致谢。

I'm M1 user and coding on python 3.9.10 up to now.

I try updating lib. with homebrew, especially for python 3.9.12 and HDF5. Also I reinstalled h5py. Here I tried.

brew update & upgrade
brew reinstall hdf5
export HDF5_DIR=/opt/homebrew/Cellar/hdf5/1.13.0/
pip install h5py --upgrade --no-dependencies --force

All upgrade was done. However, I met such an error message when I tried codes, which has no error based on previous build environments.

>     import h5py
>  File "/opt/homebrew/lib/python3.9/site-packages/h5py/__init__.py", line 25, in  <module>
>    from . import _errors
> ImportError: dlopen(/opt/homebrew/lib/python3.9/site-packages/h5py/_errors.cpython-39- darwin.so, 0x0002): Library not loaded: /opt/homebrew/opt/hdf5/lib/libhdf5.300.dylib
>  Referenced from: /opt/homebrew/lib/python3.9/site-packages/h5py/_errors.cpython-39-darwin.so
>  Reason: tried: '/opt/homebrew/opt/hdf5/lib/libhdf5.300.dylib' (no such file), '/usr/local/lib/libhdf5.300.dylib' (no such file), '/usr/lib/libhdf5.300.dylib' (no such file), '/opt/homebrew/Cellar/hdf5/1.12.1_1/lib/libhdf5.300.dylib' (no such file), '/usr/local/lib/libhdf5.300.dylib' (no such file), '/usr/lib/libhdf5.300.dylib' (no such file)

As shown above, hdf5_dir is fixed on 1.12.1_1 after brew upgrade, even I already installed 1.13.0 which didn't make a problem until trying brew upgrade.
Please, help me if anyone know what makes the problem and how to solve it.

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

(り薆情海 2025-01-26 12:31:03

以下对我有用。首先,卸载H5PYHDF5(还删除了我的pip缓存,但不确定这有多相关)。然后跑

> brew install hdf5
> export HDF5_DIR="$(brew --prefix hdf5)"
> pip install --no-binary=h5py h5py

The following worked for me. First, uninstall h5py and hdf5 (also deleted my pip cache, but not sure how relevant this is). Then just run

> brew install hdf5
> export HDF5_DIR="$(brew --prefix hdf5)"
> pip install --no-binary=h5py h5py
禾厶谷欠 2025-01-26 12:31:03

对我来说,酿造安装无效。以下有效:

pip uninstall h5py
pip install h5py

for me, brew install did not work. the following worked:

pip uninstall h5py
pip install h5py
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文