Fastkaggle failing to load paddy-disease-classification

Hi there,

I am trying to use setup_comp from the fastkaggle library but encounter an authorization error when I attempt to download the paddy-disease-classification data. I do not encounter the error when attempting to download the titanic dataset.

I have reset my API keys and updated them in my ~/.kaggle/kaggle.json directory. They seem to be valid.

The code:

!pip install fastkaggle
# install fastkaggle if not available
try: import fastkaggle
except ModuleNotFoundError:
    !pip install -Uq fastkaggle

from fastkaggle import *

comp = 'paddy-disease-classification'
path = setup_comp(comp, install='"fastcore>=1.4.5" "fastai>=2.7.1" "timm>=0.6.2.dev0"')

The error print-out:

File /usr/local/lib/python3.9/dist-packages/kaggle/, in ApiClient.__call_api(self, resource_path, method, path_params, query_params, header_params, body, post_params, files, response_type, auth_settings, _return_http_data_only, collection_formats, _preload_content, _request_timeout)
    158 url = + resource_path
    160 # perform request and return response
--> 161 response_data = self.request(
    162     method, url, query_params=query_params, headers=header_params,
    163     post_params=post_params, body=body,
    164     _preload_content=_preload_content,
    165     _request_timeout=_request_timeout)
    167 self.last_response = response_data
    169 return_data = response_data

File /usr/local/lib/python3.9/dist-packages/kaggle/, in ApiClient.request(self, method, url, query_params, headers, post_params, body, _preload_content, _request_timeout)
    349 """Makes the HTTP request using RESTClient."""
    350 if method == "GET":
--> 351     return self.rest_client.GET(url,
    352                                 query_params=query_params,
    353                                 _preload_content=_preload_content,
    354                                 _request_timeout=_request_timeout,
    355                                 headers=headers)
    356 elif method == "HEAD":
    357     return self.rest_client.HEAD(url,

ApiException: (401)
Reason: Unauthorized
HTTP response headers: HTTPHeaderDict({'Content-Length': '0', 'Date': 'Thu, 16 Feb 2023 14:22:25 GMT', 'Access-Control-Allow-Credentials': 'true', 'Set-Cookie': 'ka_sessionid=096c968188b38d120baf78ad22dfe948; max-age=2626560; path=/, GCLB=CKnm6P794s_RJg; path=/; HttpOnly', 'Turbolinks-Location': '', 'Strict-Transport-Security': 'max-age=63072000; includeSubDomains; preload', 'Content-Security-Policy': "object-src 'none'; script-src 'nonce-NcYDf/B7SnGb+hZUMzAOxw==' 'report-sample' 'unsafe-inline' 'unsafe-eval' 'strict-dynamic' https: http:; frame-src 'self'; base-uri 'none'; report-uri;", 'X-Content-Type-Options': 'nosniff', 'Referrer-Policy': 'strict-origin-when-cross-origin', 'Via': '1.1 google', 'Alt-Svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000'})

What could be going on here?

Have you checked the Kaggle page for that comp? You may have to accept or register first to access the data.


Thanks Allen, that solved it for me

1 Like