I have this error when opening my netcdf file. The code was working before. How do I fix this ?
Traceback (most recent call last):
File "", line 1, in ...
File "file.py", line 71, in gather_vgt return xr.open_dataset(filename)
File "/.../lib/python3.6/site-packages/xarray/backends/api.py", line 286, in open_dataset autoclose=autoclose)
File "/.../lib/python3.6/site-packages/xarray/backends/netCDF4_.py", line 275, in open ds = opener()
File "/.../lib/python3.6/site-packages/xarray/backends/netCDF4_.py", line 199, in _open_netcdf4_group ds = nc4.Dataset(filename, mode=mode, **kwargs)
File "netCDF4/_netCDF4.pyx", line 2015, in netCDF4._netCDF4.Dataset.init
File "netCDF4/_netCDF4.pyx", line 1636, in netCDF4._netCDF4._ensure_nc_success
OSError: [Errno -101] NetCDF: HDF error: b'file.nc'
When I try to open the same netcdf file with h5py I get this error :
OSError: Unable to open file (file locking disabled on this file system (use HDF5_USE_FILE_LOCKING environment variable to override), errno = 38, error message = '...')
You must be in this situation :
your HDF5 library has been updated (1.10.1) (netcdf uses HDF5 under the hood)
your file system does not support the file locking that the HDF5 library uses.
In order to read your hdf5 or netcdf files, you need set this environment variable :
For references, this was introduced in HDF5 version 1.10.1,