I successfully installed h5py but I am not able to read a hdf5 file that is stored in my desktop. I typed the following in VSCode:

import h5py
f = h5py.File("/home/nbg22002/Desktop/1D_Burgers_Sols_Nu0.001.hdf5","r")

Then I get the following error message:

File "/home/nbg22002/Desktop/BurgersData.py", line 7, in <module>
    import h5py
  File "/home/nbg22002/Desktop/h5py.py", line 4, in <module>
    with h5py.File(filename, "r") as f:
AttributeError: partially initialized module 'h5py' has no attribute 'File' (most likely due to a circular import)

I tried reinstalling hfpy and some suggestions I found online, but I can't get through the basic task of reading the hdf5 file

0

There are 0 best solutions below