我试图使用以下方法打开一个h5文件:
f = h5py.File('galpro/model1/posteriors/posteriors.h5', 'r')我得到了错误
BlockingIOError Traceback (most recent call last)
/tmp/ipykernel_3608836/2835026146.py in <module>
----> 1 f = h5py.File('galpro/model1/posteriors/posteriors.h5', 'a')
~/.local/lib/python3.7/site-packages/h5py/_hl/files.py in __init__(self, name, mode, driver, libver, userblock_size, swmr, rdcc_nslots, rdcc_nbytes, rdcc_w0, track_order, fs_strategy, fs_persist, fs_threshold, fs_page_size, page_buf_size, min_meta_keep, min_raw_keep, locking, **kwds)
505 fs_persist=fs_persist, fs_threshold=fs_threshold,
506 fs_page_size=fs_page_size)
--> 507 fid = make_fid(name, mode, userblock_size, fapl, fcpl, swmr=swmr)
508
509 if isinstance(libver, tuple):
~/.local/lib/python3.7/site-packages/h5py/_hl/files.py in make_fid(name, mode, userblock_size, fapl, fcpl, swmr)
230 # existing one (ACC_EXCL)
231 try:
--> 232 fid = h5f.open(name, h5f.ACC_RDWR, fapl=fapl)
233 # Not all drivers raise FileNotFoundError (commented those that do not)
234 except FileNotFoundError if fapl.get_driver() in (
h5py/_objects.pyx in h5py._objects.with_phil.wrapper()
h5py/_objects.pyx in h5py._objects.with_phil.wrapper()
h5py/h5f.pyx in h5py.h5f.open()
BlockingIOError: [Errno 11] Unable to open file (unable to lock file, errno = 11, error message = 'Resource temporarily unavailable')我最初得到的错误是:
OSError: Unable to open file (bad object header version number)但是,一旦我重新下载了该文件,它就给了我'BlockingIOError: Errno 11无法打开文件(无法锁定文件,errno = 11,错误消息= 'Resource‘)的错误消息。
我不知道是怎么回事或者怎么打开文件。请帮帮我!
发布于 2022-03-15 12:50:33
注意:我发现升级iPython和h5py包解决了这个问题。
https://stackoverflow.com/questions/71482468
复制相似问题