OSError: [Errno -51] NetCDF: Unknown file format: b'output1.nc' 解决方案

必然是你的.nc文件不完整

code
Traceback (most recent call last):
File “”, line 1, in
File “D:\Program Files\JetBrains\apps\PyCharm-P\ch-0\192.7142.42\helpers\pydev_pydev_bundle\pydev_umd.py”, line 197, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File “D:\Program Files\JetBrains\apps\PyCharm-P\ch-0\192.7142.42\helpers\pydev_pydev_imps_pydev_execfile.py”, line 18, in execfile
exec(compile(contents+"\n", file, ‘exec’), glob, loc)
File “D:/Users/张志浩/PycharmProjects/untitled2/ECMWF/readNc.py”, line 12, in
nc_obj = Dataset ( “output1.nc” )
File “netCDF4_netCDF4.pyx”, line 2321, in netCDF4._netCDF4.Dataset.init
File “netCDF4_netCDF4.pyx”, line 1885, in netCDF4._netCDF4._ensure_nc_success
OSError: [Errno -51] NetCDF: Unknown file format: b’output1.nc’
result

posted @ 2019-12-02 19:29  爱做梦的子浩  阅读(823)  评论(0编辑  收藏  举报