2

I am working in a project in which I need to use PyQGIS and H5PY. The problem comes when I load qgis library and h5py, for example:

import qgis
import h5py

I get this error:

from ._conv import register_converters as _register_converters File "h5py\h5r.pxd", line 21, in init h5py._conv File "h5py_objects.pxd", line 12, in init h5py.h5r File "h5py_objects.pyx", line 1, in init h5py._objects ImportError: DLL load failed: No se encontró el proceso especificado.

I am using QGIS 3.2 and H5py 2.8.0 with Python36 interpreter contained in QGIS installation folder. H5py was installed through the command:

python -m pip install h5py 

I tried other versions of H5py (2.6.0, 2.7.1) but I had the same problem.

Is there anyone who knows how to solve this dll interaction problem?

  • Maybe this: stackoverflow.com/questions/45046796/… – Marc Pfister Dec 10 '18 at 15:40
  • As Marc Pfister's link shows, there is an osgeo4w package for that library and it's recommended to install those instead of pip packages. It's name for python3 is python3-h5py, Version: 2.8.0-1 (32 bit, 64bit may differ) – Andreas Müller Dec 10 '18 at 15:56
  • I tried with OSGEO4w package but a new problem comes up. When I install the version 2.7.0-1 it throws a message saying that the version of the HDF5 library does not match with the version of the library (QGIS). Version 2.8.0-1 comes with Python37 which has some strange behaviour with Qt module (I think it does not find the correct qt.conf file) that I have to solve. Thanks! – serge Dec 11 '18 at 15:39
  • I have checked with QGIS 3.4 and even loading h5py module from python console inside QGIS 3.4 program the dll problem still persist... – serge Dec 11 '18 at 16:52
0

I think your issue is that you don't have HDF5 built on your machine. All that h5py does is it creates a more pythonic API for accessing the compiled libraries on your machine. If you don't have the base libraries (DLLs), it will fail.

Start by uninstalling h5py with python -m pip uninstall h5py and then proceed through the installation/configuration instructions for HDF5 (https://www.hdfgroup.org/downloads/hdf5/). After that, reinstall h5py. Hope that helps!

0

I had python package gdal installed using OSGeo4W environment. And then I installed h5py using PyCharm (maybe it is important). And realized, that when importing gdal (osgeo, ogr, ...) before importing h5py library, I get the same error as you. But when I import h5py first, no error appears. Don't know why, but maybe it helps someone.

Well I have tried it also with qgis library and it's the same. So I would try first import h5py library and then qgis:

import h5py
import qgis

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.