我安装了OSGeo4W软件包,以便在Windows环境中使用h5py。
我使用OSGeo shell使用pip install安装h5py。
C:\Users\Public\Desktop\OSGeo4W>pip install h5py
当我打开QGIS并转到QGIS中的Python控制台时,我收到此错误:
import h5py
Traceback (most recent call last):
File "", line 1, in
File "C:/OSGEO41/apps/qgis/./python\qgis\utils.py", line 607, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\OSGEO41\apps\Python27\lib\site-packages\h5py_init_.py", line 43, in
from . import h5a, h5d, h5ds, h5f, h5fd, h5g, h5r, h5s, h5t, h5p, h5z
File "C:/OSGEO41/apps/qgis/./python\qgis\utils.py", line 607, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "h5py\h5p.pxd", line 16, in init h5py.h5a (D:\Build\h5py\h5py-2.7.0\h5py\h5a.c:6968)
File "C:/OSGEO41/apps/qgis/./python\qgis\utils.py", line 607, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: DLL load failed: ÁöÁ¤µÈ ÇÁ·Î½ÃÀú¸¦ ãÀ» ¼ö ¾ø½À´Ï´Ù.
我不知道如何在QGIS python控制台中使用h5py
答案 0 :(得分:1)
检查https://github.com/h5py/h5py/issues/828。 如果使用
安装pip install h5py
import h5py
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 607, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\OSGEO4~1\apps\Python27\lib\site-packages\h5py\__init__.py", line 43, in <module>
from . import h5a, h5d, h5ds, h5f, h5fd, h5g, h5r, h5s, h5t, h5p, h5z
File "C:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 607, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "h5py\h5p.pxd", line 16, in init h5py.h5a (D:\Build\h5py\h5py-2.7.0\h5py\h5a.c:6968)
File "C:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 607, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: DLL load failed: No se encontró el proceso especificado.
然后,第一次使用OSgeo shell
取消使用此包pip uninstall h5py
要使用它,需要从 Osgeo4W 进行安装,高级安装并在重新启动 QGIS 时安装此python-h5py
,再试一次import h5py
和voilà !