netcdf 文件的 xarray 中出现 IO 后端错误

sau*_*ore 5 python io netcdf python-xarray

我正在尝试使用 xarray 打开 .netcdf 文件,但它显示此错误。我无法解决此错误,并且没有找到解决此错误的解决方案。我尝试过不同版本的 Anaconda 和 Ubuntu,但问题仍然存在。

ValueError:在 xarray 当前安装的 IO 后端 ['scipy'] 中找不到匹配项。engine考虑通过xarray.open_dataset() 的参数 明确选择已安装的后端之一,或安装其他 IO 依赖项: http: //xarray.pydata.org/en/stable/getting-started-guide/installing.html http://xarray.pydata.org/en/stable/getting-started-guide/installing.html http://xarray.pydata.org/en/stable/getting-started-guide/installing.html /xarray.pydata.org/en/stable/user-guide/io.html

小智 5

我遇到过同样的问题。然后我通过以下方式安装了netCDF4:

pip install netCDF4 
Run Code Online (Sandbox Code Playgroud)

和 xarray 工作。小心依赖!!


Wil*_*off 0

根据您的错误消息,看来您只是缺少scipy依赖项。

我建议conda install在终端/命令行或 Jupyter 中使用安装(如果您使用该 IDE): conda install scipy

如果您使用的 Python 环境不是基本环境,请确保您通过在终端中导航(例如conda activate MYENV)或在 Jupyter 中运行该环境内核来安装到项目所使用的环境。

如果您使用 Jupyter,您可能需要重新启动内核才能使更改生效。