import H5py library in SideFx_Houdini18.5

Hi everyone,
I’m trying to figure out how to import that library into the this 3D software. The version of python used by Houdini is Python 2.7.15 (default, Mar 10 2020, 16:25:26) [MSC v.1916 64 bit (AMD64)].

The error I encounter is the following:

Python error: Traceback (most recent call last):
File “”, line 11, in
File “C:\Python27\Lib\site-packages\h5py_init_.py”, line 26, in
from . import _errors
ImportError: DLL load failed: Impossibile trovare il modulo specificato.

i think the problem is the complied version, but I just don’t know how to fix it.

Can someone help me? thanks

Paolo

Houdini appears to be using a custom build of python 2.7.15, which was released on 1 May, 2018. Did you install h5py using a binary wheel, build it from source, or something else?

The error ImportError: DLL load failed: Impossibile trovare il modulo specificato. often means a compiler runtime library isn’t being found.

Binary wheels should be built using the same compiler used to build python. If you can’t find one that matches your Python version, you will need to build h5py from source. See Preparing the Windows Build Environment (from PyWavelets) (should also apply to h5py and the hdf5 library) and h5py Windows Build Instructions . If you are lucky, another Houdini user has already done the work and can share the binary wheel.

Hey there, coincidentally I’m stuck on something similar. I’m trying to import h5py into a plugin for Cura (a 3D-printing application). @p.colagrossi, maybe you can get a hint in my post at Cura’s forum.

In any case, I manage to import it using ctypes, but it fails to actually import its contents. @gnwiii, do you think it’s due to the same root cause as with Houdini? If not, I’ll make another thread.

Hi gnwii,
thank for your reply!

I’ve istalled "h5py-2.10.0-cp27-cp27m-win_amd64.whl (2.4 MB) " from https://pypi.org/project/h5py/2.10.0/#files.

I’ve also tried a unofficial Windows Binaries Extension Packages https://www.lfd.uci.edu/~gohlke/pythonlibs/
but to no avail.

I’m horrible with compiling etc, so I’m not able to compile the version of Binary wheels by myself. I hope someone can share that.

The correct source for me is: https://github.com/h5py/h5py/releases/tag/2.10.0 right?

I found this page (https://3deeplearner.org/binary-comp/) but it’s too hard for my skills to follow.

Do you know if there some tutorial (video it would be better) that explain step by step how to do that wheels?

Thank you very much, any advice is very welcome.

Cheers

Paolo

The solution is to provide the python interpreter with the path-to-your-module. The simplest solution is to append that python path to your sys.path list. In your notebook, first try:

import sys
sys.path.append('my/path/to/module/folder')

This isn’t a permanent change in sys.path, because when you log out, your environment is reset, so any variables you may have set are lost.

The better (and more permanent) way to solve this is to set your PYTHONPATH, which provides the interpreter with additional directories look in for python packages/modules.

from BASH type: export PYTHONPATH=/path/to/new/folder:/another/path/...../ #each path must be separated by a colon