h5py无法打开文件:BlockingIOError:[E 11]无法打开文件(无法锁定文件,errno = 11,错误消息=“资源暂时不可用”)
我正在尝试使用以下方法打开 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,错误消息 = '资源暂时不可用')' 错误信息。
我不确定出了什么问题或如何打开该文件。请帮忙!
I'm trying to open a h5 file using:
f = h5py.File('galpro/model1/posteriors/posteriors.h5', 'r')
And I get the error
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')
I originally got the error:
OSError: Unable to open file (bad object header version number)
However, once I redownloaded the file it gave me the 'BlockingIOError: [Errno 11] Unable to open file (unable to lock file, errno = 11, error message = 'Resource temporarily unavailable')'
error message.
I'm not sure what's wrong or how to open the file. Please help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Nb:我发现升级 iPython 和 h5py 包解决了问题
Nb: I found that upgrading iPython and h5py packages solved the problem