ubuntu安装HDF5 1.10.4 以及对应的python hdf5包

1. 安装HDF5 1.10以及对应的python hdf5的包  (HDF5 1.10.4安装具体可参考其他博客) 

2. 使用命令行环境变量安装对应的python hdf5包,HDF5_DIR=/usr/local/hdf5 pip install h5py

系统内安装有其他HDF5版本,比如1.8.16,为了使用新安装的版本所以添加环境变量制定使用的HDF5版本

(参考:https://groups.google.com/forum/#!topic/h5py/j6wolQ1vJgE

一个HDF5-1.10.1的下载链接:https://download.csdn.net/download/heartwasd95/10742368

具体步骤如下:

Then you should be fine. Install HDF5 1.10 from source into somewhere you want to. The .tar is here:
https://www.hdfgroup.org/HDF5/release/obtainsrc5110.html
Follow the install readme but basically you just need to give it a directory with:
> ./configure --prefix=/usr/local/hdf5  (这次失误在新机器上安装在了/usr/local/,以后用到时需要注意路径指定在/usr/local/)
before you make and then,

> make -j 32 ## 嘿嘿嘿,boss给买了双cpu的服务器,最多支持32进程 ?

> make check -j 32

> sudo make install -j 32

> sudo make check-install  -j 32

Now install with you anaconda version of python. You may want to make a separate environment using conda but that's your call. 

Remove the h5py you have with anaconda using 
> conda uninstall h5py 
or
> pip uninstall h5py

Then use pip to reinstall h5py but pointing to the HDF5 library you made from source. From here: http://docs.h5py.org/en/latest/build.html
> HDF5_DIR=/usr/local/hdf5 pip install h5py (对我的机器而已,指定路径 HDF5_DIR=/usr/local/ pip install hfpy)

Then you should be good. Open up a python terminal and test if you can use SWMR mode:
> import h5py
> f = h5py.File("./swmr.h5", 'a', libver='latest', swmr=True) # SWMR (Single-Writer/Multiple-Reader)

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值