Thanks Christian, It turned out that h5py.defs was not the only hidden import that I needed to add.
I managed to get it working with the follwoing command adding 4 hidden imports. pyinstaller --hidden-import=h5py.defs --hidden-import=h5py.utils --hidden-import=h5py.h5ac --hidden-import=h5py._proxy test.py is there anyway that you can use to add all h5py submodules all together? Thanks, -- https://mail.python.org/mailman/listinfo/python-list