You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用xarray的open_mfdataset读取netCDF4文件时遇DLL加载错误

问题描述

我正在通过Jupyter Notebook完成一个机器学习练习,已成功安装netCDF4、rioxarray、xarray、tensorflow等必要包。但调用xarray的open_mfdataset函数读取netCDF4数据集时出现错误。

执行代码

z500 = xr.open_mfdataset('geopotential_500*.nc', combine='by_coords').isel(time=slice(None, None, 12))
z500

核心报错信息

...
ImportError: DLL load failed while importing defs: The specified procedure could not be found.

完整代码

# Import packages
import xarray as xr
import numpy as np

# Load in the necessary python packages to train in the neural network
import tensorflow.keras as keras
import tensorflow as tf

# Unzip the data
import os
from zipfile import ZipFile

path = "C:/Users/gachuhi/gis800"
filepath = os.path.join(path, 'geopotential_500_5.625deg.zip')
with ZipFile(filepath, 'r') as zObject:
              zObject.extractall(path=os.path.join(path, 'geopotential'))

z500 = xr.open_mfdataset('C:/Users/gachuhi/gis800/geopotential/geopotential_500*.nc', combine='by_coords').isel(time=slice(None, None, 12))
z500

完整错误详情

C:\Users\gachuhi\anaconda3\envs\python-gis\lib\site-packages\xarray\backends\plugins.py:71: RuntimeWarning: Engine 'rasterio' loading failed:
DLL load failed while importing _version: The specified procedure could not be found.
  warnings.warn(f"Engine {name!r} loading failed:\n{ex}", RuntimeWarning)
.....
--snip, too long--
.....
File h5py\h5.pyx:1, in init h5py.h5()

ImportError: DLL load failed while importing defs: The specified procedure could not be found.

我尝试导入rasterio、netCDF4均无法解决问题,现在没法按预期合并netCDF4文件进行后续分析,请问该如何解决?


内容的提问来源于stack exchange,提问作者Samuel Gachuhi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.03 16:55:17