Hi,
I am sharing my solution below for whoever might come across the same difficulties regarding downloading data via the kaggle api for the notebook 09_tabular.ipynb related to the fastai2 book. (if there is a simpler solution please feel free to share it):
-
As suggested in the notebook download kaggle.json on your computer and upload on colab via the upload button.
-
Go to the link provided in the notebook to accept the rules for the kaggle data
-
Make sure you have GPU runtime. After cell one in the notebook I run the following lines (as suggested here)
! pip install dtreeviz # this package was not preinstalled either ! pip install -q kaggle ! mkdir ~/.kaggle !cd ~ ! cp kaggle.json ~/.kaggle/ ! chmod 600 ~/.kaggle/kaggle.json
-
Provide your kaggle credentials as described in the notebook
And 5) I replaced the line path.mkdir()
in the following as:
if not path.exists():
#path.mkdir()
path.parent.mkdir(exist_ok=True)
api.competition_download_cli('bluebook-for-bulldozers', path=path)
file_extract(path/'bluebook-for-bulldozers.zip')
Thanks,
M