python h5py module install in Paraview?

I am trying to implement a programmable filter in Paraview that requires the python h5py module. The python bundled with Paraview does not include that module, and I cannot find an easy way to install it there myself. Any ideas would be much appreciated!
Many thanks

Hi Ian,

I have done exactly this a few times before. It is a bit tricky since the python version (UCS2) included with the paraview bundle is different from most system pythons.

If you want to build a h5py compatible with the paraview bundle you can use pyenv and install the correct hdf5 locally (you need the header files to compile h5py).
You can find some instructions on

Let me copy them here for completeness. You might need to change the version numbers depending on your paraview version.

# run this script in ParaView-5.4.1-Qt5-OpenGL2-MPI-Linux-64bit or equivalent or set PV_DIR
export PV_DIR=$(pwd)

# Install python2 with ucs2
export PYTHON_CONFIGURE_OPTS=--enable-unicode=ucs2
pyenv install -v 2.7.11
pyenv local 2.7.11

# Install pip
wget && ~/.pyenv/shims/python

# Install the same numpy paraview uses (as of writing)
~/.pyenv/versions/2.7.11/bin/pip install --user numpy==1.8.1

# Install hdf5 of the same version as paraview (not enough files included in binary paraview distribution to build against)
# Paraview 5.2 - 5.4.1 are using 1.8.13, I have not checked the rest
# We then take the install summary 
cd ~
tar jxf hdf5-1.8.13.tar.bz2
cd hdf5-1.8.13
make -j
make install # in ~/hdf5-1.8.13/hdf5

# Install h5py against the paraview hdf5 libraries
export HDF5_DIR=~/hdf5-1.8.13/hdf5
~/.pyenv/versions/2.7.11/bin/pip install --no-binary=h5py --user h5py

# Copy it to your paraview folder to make a portable version, or leave it in your local site-packages
mv ~/.local/lib/python2.7/site-packages/h5py $PV_DIR/lib/python2.7/site-packages/
# Create symlinks to the paraview library files (since we built against slightly different hdf5 the name is different)
cd $PV_DIR/lib/paraview-*
ln -s
ln -s

# Clean up
rm -r ~/hdf5-1.8.13.tar.bz2 ~/hdf5-1.8.13

Best of luck,

Many thanks for pointing me in the right direction, Daan. I will have a go at this over the weekend and report back!