Issues when running file in HDF5 file format from Datacamp

Hello guys,

I am getting an issue with .hdf5 file type that I downloaded from Datacamp (I am currently enrolling an EDA course here) when trying to read it on jupyter notebook. Whenever executing the code, I always got issues like the picture I attached here. Do you guys have any ideas in solving this? I walked through as many ways on every forum/ webpage as possible that I could find to solve this kind of problem but got failed all the time.

Thank you for all your help here!

Run the following line in a cell in your notebook above the cell you are trying to read the HDF5:

%conda install pytables

That is based on here. I’m suggesting that first because from your included image I can see you are using Anaconda.

If that doesn’t fix it, then try running replacing that suggestion with this one, based on here:

%pip install tables

If you aren’t familiar with the %conda install and %pip install magic commands now in Jupyter, see my last paragraph in this post. The last line in the error was trying to direct you how to fix the issue. Conda is the package manager for Anaconda. It’s a general package manager and installs all sorts of things, not just Python-related. pip is the package manager for the Python package Index and only installs things linked to the Python installation.

1 Like

Dear fomightez,

I’m really thankful for your help. After running these 2 lines, however, I’m still getting the same issue as attached picture. I tried some various ways that I found on Stacked Over Flow but being failed still. Could you please suggest me some other ways in solving this? Really thank for it.

Please kindly refer to below links for my notebook as well as the hdf5 file. Thank you!!!

hdf5 file

Here suggests trying this in a cell towards the top of your notebook:

%conda install snappy

After doing that, restart the kernel and try reading your HDF5 file.


Try running in a cell the following:

import tables

After doing that, if you don’t see an error, try reading your HDF5 file. (DO NOT RESTART KERNEL IN BETWEEN THE import and read STEPS.)

According to here, doing the import and then trying to read the file, fixed it.
Even if that doesn’t fix things, make a note of whether you see an error after the import attempt. There was a suggestion that the error would help you trace if an issue with pytables installation or that there is an issue with pandas. I think reinstalling or upgrading pandas would be advisable next if the import attempt works but doesn’t fix the issue.

Try the following in a cell:

%conda update h5py pandas 

Restart the kernel after that before trying to read the HDF5 again.

If that doesn’t seem to do anything, try in a Jupyter cell:

%pip install --upgrade h5py
%pip install --upgrade pandas

If none of those work…
In regards to your last screenshot:

I would have liked to have seen the result after you ran %conda install pytables, too.
Did you try restarting the kernel after running the %conda install line?