h5py无法打开文件:BlockingIOError:[E 11]无法打开文件(无法锁定文件,errno = 11,错误消息=“资源暂时不可用”)

发布于 2025-01-14 10:08:50 字数 1874 浏览 1 评论 0原文

我正在尝试使用以下方法打开 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夜血缘 2025-01-21 10:08:50

Nb:我发现升级 iPython 和 h5py 包解决了问题

Nb: I found that upgrading iPython and h5py packages solved the problem

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文