[英]blosc compression in hdf5 via h5py
我正在使用h5py在python中创建hdf5文件,我想使用blosc作为压缩过滤器。 我首先从源代码安装了c-blosc:
wget https://github.com/Blosc/c-blosc/archive/v1.9.1.tar.gz
tar -xvf c-blosc-v1.9.1.tar.gz
cd c-blosc-v1.9.1
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local ..
cmake --build .
cmake --build . --target install
(注意我使用自制软件,所以我的/ usr / local是可写的,没有sudo)
然后我从源代码安装了hdf5 v1.10.0:
wget http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.0/src/hdf5-1.10.0.tar.gz
tar -xvf hdf5-1.10.0.tar.gz
cd hdf5-1.10.0
./configure --enable-static=yes --enable-shared=yes --prefix=/usr/local/hdf5
make && make install
最后我从源代码安装h5py v2.6.0:
wget https://github.com/h5py/h5py/archive/2.6.0.tar.gz
tar -xvf h5py-2.6.0.tar.gz
cd h5py-2.6.0
python setup.py install
python setup.py install
但是,当我启动python解释器并运行时:
import h5py
f = h5py.File('myFile.hdf5','w')
dset = f.create_dataset("myData", (100, 100), compression=32001)
#32001 is blosc, see: https://www.hdfgroup.org/services/filters.html
我收到错误“ValueError:Unknown compression filter number:32001”。 我在安装流中错过了什么?
在import h5py
之前
你需要import tables
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.