Kaggle Troubleshooting Handbook

Make sure that you are using the SSH/Terminal from NimbleBox to run the following commands.

Connect with Kaggle

Generate the API token from

  1. My Account
  2. API
  3. Click “Create New API Token”.
  4. A Kaggle.json will be downloaded with the username and token key.
  5. Upload Kaggle.json to NimbleBox

Note: Make sure you click on ‘Expire API token’ before creating new API token.

Download datasets using Kaggle’s public API

Step 1 : Create a directory named Kaggle.

mkdir - make directory

Troubleshooting: ‘You might encounter kaggle command not found error when running commands on jupyter notebook or kaggle is not installed in the first place’

Step 2 : Make sure Kaggle.json file is present inside the Kaggle directory

cp <source-file> <destination-file>
eg: cp /mnt/disks/user/project/kaggle.json ~/.kaggle

cp command helps to copy from the source file to destination file

Double check: Make sure the path mentioned is correct inside NimbleBox

Step 3 : Provide the required access permission using the following command

chmod 600 ~/.kaggle/kaggle.json

Step 4 : Connect to our proxy

kaggle config set -n proxy -v $HTTPS_PROXY

Step 5: Use download command from Kaggle to upload the required dataset.

kaggle datasets download -d <dataset-location>

example: kaggle datasets download -d alxmamaev/flowers-recognition

Trouble shooting: ‘401 unauthorised’ : Issue occurs when kaggle.json isn’t the latest (API token has expired). Generate a new kaggle.json file and upload to NimbleBox

Kaggle downloads the folder in the zip format.

Steps to unzip the folder

sudo apt update

Download zip and unzip command

sudo apt install p7zip-full unzip zip

Use this command to unzip

7za x <filename>.zip

Example: 7za x flowers-recognition.zip

Replace with the name of the file that is required to be unzipped

2 Likes