簡體   English   中英

h5py cant open file: BlockingIOError: [E 11] Unable to open file (unable to lock file, errno = 11, error message = '資源暫時不可用')

[英]h5py cant open file: BlockingIOError: [E 11] Unable to open file (unable to lock file, errno = 11, error message = 'Resource temporarily unavailable')

我正在嘗試使用以下方法打開 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] Unable to open file (unable to lock file, errno = 11, error message = 'Resource temporary unavailable')” 錯誤消息。

我不確定出了什么問題或如何打開文件。 請幫忙!

Nb:我發現升級 iPython 和 h5py 包解決了這個問題

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM