Shikha Dubey
Shikha Dubey

Reputation: 51

Error while accessing .hdf5 file, shows error “OSError: Unable to open file ”

When I tried to open an .hdf5 file with h5py:

import h5py

file=h5py.open(".../f.hdf5",'r'),

The following error was raised:

h5py/h5f.pyx in h5py.h5f.open()

OSError: Unable to open file (unable to lock file, errno = 11, error message = 'Resource temporarily unavailable')

Upvotes: 0

Views: 7370

Answers (1)

Shikha Dubey
Shikha Dubey

Reputation: 51

Solutions: The error could be solved for opening .hdf5 files as below:

file= h5py.File(file_path,'r')

  1. close the files using file.close() or
  2. import os
    os.environ["HDF5_USE_FILE_LOCKING"] = "FALSE"

Then the error while opening the file will be gone and you can keep working on that file.

Upvotes: 4

Related Questions