- 积分
- 328
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2013-5-9
- 最后登录
- 1970-1-1
|
发表于 2023-8-31 15:42:25
|
显示全部楼层
我已经成果安装了xarray 和netCDF4以及numpy包,但是用下面命令打开就是无法正常打开Nc 文件
例如如下:
import xarray as xr
data2 = xr.open_dataset('D:\data\mm.nc')
print(data2)
运行报错:
[size=13.0667px]D:\python\python.exe E:\py_work\read.py Traceback (most recent call last): File "E:\py_work\read.py", line 12, in <module> data2 = xr.open_dataset('D:\data\mm.nc') File "D:\python\lib\site-packages\xarray\backends\api.py", line 479, in open_dataset engine = plugins.guess_engine(filename_or_obj) File "D:\python\lib\site-packages\xarray\backends\plugins.py", line 110, in guess_engine engines = list_engines() File "D:\python\lib\site-packages\xarray\backends\plugins.py", line 105, in list_engines entrypoints = entry_points().get("xarray.backends", ())AttributeError: 'EntryPoints' object has no attribute 'get'
[size=13.0667px]
[size=13.0667px]
[size=13.0667px]
[size=13.0667px]
[size=13.0667px]但是使用
import netCDF4
from netCDF4 import Dataset
data = Dataset('D:\data\mm.nc')
print(data)
就可以成功打开Nc文件
是什么原因呢
|
|