通过CONDA安装的HDF5,但是可以找到``hdf5`位置''

发布于 2025-02-06 07:57:00 字数 1363 浏览 4 评论 0原文

我正在尝试安装最新版本的HDF5 1.12.1(通过conda)和H5PY 3.6.0(通过pip3)。

这两个软件包都是通过最近版本的Conda成功安装的,但我的环境不包含HDF5。

h5py

# This was succesfully installed and found in the correct directory
pip3 show h5py

    Name: h5py\
    Version: 3.6.0 \
    Summary: Read and write HDF5 files from Python\
    Home-page: http://www.h5py.org \
    Author: Andrew Collette\
    Author-email: [email protected] \
    License: BSD\
    Location: /home/goldpm1/miniconda3/envs/cnvpytor/lib/python3.7/site-packages\
    Requires: cached-property, numpy\
    Required-by: CNVpytor, selene-sdk, signatureanalyzer

hdf5

# conda list shows that hdf5 newest version is insatalled, but I can't find at all at the conda environment
conda list hdf5
     
Name             Version                   Build        Channel
hdf5              1.12.1      nompi_h4df4325_104    conda-forge

# I can't find actual hdf5 location in /home/goldpm1/miniconda3/envs/cnvpytor
which hdf5

    /usr/bin/which: no hdf5 in (............)

我的conda发生了什么?我该如何解决我的问题?

I'm trying to install the recent version HDF5 1.12.1 (via conda) and h5py 3.6.0 (via pip3).

Both package were installed successfully through the recent version of Conda, but my environment does not contain HDF5.

h5py

# This was succesfully installed and found in the correct directory
pip3 show h5py

    Name: h5py\
    Version: 3.6.0 \
    Summary: Read and write HDF5 files from Python\
    Home-page: http://www.h5py.org \
    Author: Andrew Collette\
    Author-email: [email protected] \
    License: BSD\
    Location: /home/goldpm1/miniconda3/envs/cnvpytor/lib/python3.7/site-packages\
    Requires: cached-property, numpy\
    Required-by: CNVpytor, selene-sdk, signatureanalyzer

HDF5

# conda list shows that hdf5 newest version is insatalled, but I can't find at all at the conda environment
conda list hdf5
     
Name             Version                   Build        Channel
hdf5              1.12.1      nompi_h4df4325_104    conda-forge

# I can't find actual hdf5 location in /home/goldpm1/miniconda3/envs/cnvpytor
which hdf5

    /usr/bin/which: no hdf5 in (............)

What happened in my Conda? How can I fix my problem?

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

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

发布评论

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

评论(2

怂人 2025-02-13 07:57:00

我建议使用h5py的conda版本作为管理依赖的完整堆栈,正是康达(Conda)解决的问题。也就是说,康达将保证安装了正确的依赖项:

conda install h5py

另外,我不确定为什么hdf5二进制期望二进制。 HDF5软件包提供了一堆bin/h5*二进制文件,但没有hdf5。此外,Python软件包使用includ/*。h标题,然后拨打lib/libhdf5。{so,dylib,dll},而不是HDF5二进制。

我可能还应该提到,至少对于最近的版本,PYPI上的h5py通过轮子(即,即使用静态构建)捆绑了HDF5。相比之下,Conda软件包主要使用动态链接,因此软件包可以共享依赖关系的单个副本。此外,康达(Conda)使用硬链接,因此依赖项甚至可以在环境中是单个副本。

I'd recommend using the Conda version of h5py as managing the full stack of dependencies is exactly the problem that Conda was created to solve. That is, Conda will guarantee the correct dependencies are installed:

conda install h5py

Also, I'm not sure why an hdf5 binary is expected. The hdf5 package delivers a bunch of bin/h5* binaries, but no hdf5. Moreover, the Python package uses the include/*.h headers and then makes calls into the lib/libhdf5.{so,dylib,dll}, not a hdf5 binary.

I should probably also mention that, at least for recent versions, h5py on PyPI bundles the HDF5 via wheels, i.e., uses static builds. In contrast, Conda packages mostly use dynamic linking, so packages can share single copies of dependencies. Furthermore, Conda uses hardlinking, so dependencies can even be single copies across environments.

花开半夏魅人心 2025-02-13 07:57:00

谢谢@merv!搜索三个小时后,您的解决方案对我有用。

在RHEL 9.0上,我在Conda环境中安装了R-Studio,并且我试图安装远程:: install_github(“ bnprks/bpcells”,quiet = true),由于此错误:

无法找到libhdf5。请手动安装或编辑编译器
标志。

Thank you @merv! Your solution worked for me after three hours of searching.

On RHEL 9.0, I installed R-Studio in Conda environment and I was trying to install remotes::install_github("bnprks/BPCells", quiet = TRUE) which was unsuccessful because of this error:

Unable to locate libhdf5. Please install manually or edit compiler
flags.

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