# I cannot open my h5 file

**URL:** <https://forum.hdfgroup.org/t/i-cannot-open-my-h5-file/7806>\
**Category:** HDF5 Library\
**Created:** [November 30, 2020, 12:42pm UTC](https://forum.hdfgroup.org/t/i-cannot-open-my-h5-file/7806 "2020-11-30T12:42:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![janhense](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/j/278dde/32.png) [@janhense](https://forum.hdfgroup.org/u/janhense)\
**Post date:** [November 30, 2020, 12:42pm UTC](https://forum.hdfgroup.org/t/i-cannot-open-my-h5-file/7806/1 "2020-11-30T12:42:38Z")

</div>

Hello,

I want to open my h5 file with this code:

`file = h5py.File(fpath, "r")`

But I get this error message:

`OSError: Unable to open file (file signature not found)`

It has worked before, but somehow now it doesn’t work anymore… (the path is correct, path.exists(fpath) also yields True)

---

<div class="post-metadata">

**Author:** ![gheber](https://forum.hdfgroup.org/user_avatar/forum.hdfgroup.org/gheber/32/1919_2.png) [@gheber](https://forum.hdfgroup.org/u/gheber)\
**Post date:** [November 30, 2020, 3:22pm UTC](https://forum.hdfgroup.org/t/i-cannot-open-my-h5-file/7806/2 "2020-11-30T15:22:14Z")

</div>

Can you send us the output of `h5dump -pBH <filename>` or `h5ls -r <filename>`?  
If you don’t have those tools, how about `od -cN 8 <filename>`?

G.

---

<div class="post-metadata">

**Author:** ![janhense](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/j/278dde/32.png) [@janhense](https://forum.hdfgroup.org/u/janhense)\
**Post date:** [November 30, 2020, 3:53pm UTC](https://forum.hdfgroup.org/t/i-cannot-open-my-h5-file/7806/3 "2020-11-30T15:53:08Z")

</div>

With `h5dump -pBH <fpath>` I get `zsh: parse error near`\n’`, but opening works now, after I restarted my Jupyter Notebook…

---

<div class="post-metadata">

**Author:** ![janhense](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/j/278dde/32.png) [@janhense](https://forum.hdfgroup.org/u/janhense)\
**Post date:** [December 3, 2020, 1:48pm UTC](https://forum.hdfgroup.org/t/i-cannot-open-my-h5-file/7806/4 "2020-12-03T13:48:56Z")

</div>

Mmh, I have this error again now… any other ideas except restarting the whole kernel?

 ![image](https://hdf-discourse-1.s3.amazonaws.com/original/2X/e/e4e1474d6f8642df3353993b951987b82bb0ae31.png)

---

<div class="post-metadata">

**Author:** ![janhense](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/j/278dde/32.png) [@janhense](https://forum.hdfgroup.org/u/janhense)\
**Post date:** [December 3, 2020, 2:27pm UTC](https://forum.hdfgroup.org/t/i-cannot-open-my-h5-file/7806/5 "2020-12-03T14:27:56Z")

</div>

I just restarted the kernel. Then I couldn’t open it with “r”, only with “r+”…

---

<div class="post-metadata">

**Author:** ![janhense](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/j/278dde/32.png) [@janhense](https://forum.hdfgroup.org/u/janhense)\
**Post date:** [December 3, 2020, 7:32pm UTC](https://forum.hdfgroup.org/t/i-cannot-open-my-h5-file/7806/6 "2020-12-03T19:32:07Z")

</div>

Now I get this error message, when trying to open it with h5py.File(fpath,“r+”):

`OSError: Unable to open file (file is already open for read-only)`

And in my other project:

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

EDIT: So it appears that I have opened the file under different variable names. I have one function which just does one thing, and only once, so I use the with statement for that. I guess my issue is solved!
