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/api_client.py:161, 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 = self.configuration.host + 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/api_client.py:351, 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': 'https://www.kaggle.com/api/v1/competitions/data/download-all/paddy-disease-classification', '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' https://www.kaggleusercontent.com https://www.youtube.com/embed/ https://polygraph-cool.github.io https://www.google.com/recaptcha/ https://form.jotform.com https://submit.jotform.us https://submit.jotformpro.com https://submit.jotform.com https://www.docdroid.com https://www.docdroid.net https://kaggle-static.storage.googleapis.com https://kaggle-static-staging.storage.googleapis.com https://kkb-dev.jupyter-proxy.kaggle.net https://kkb-staging.jupyter-proxy.kaggle.net https://kkb-production.jupyter-proxy.kaggle.net https://kkb-dev.firebaseapp.com https://kkb-staging.firebaseapp.com https://kkb-production.firebaseapp.com https://kaggle-metastore-test.firebaseapp.com https://kaggle-metastore.firebaseapp.com https://apis.google.com https://content-sheets.googleapis.com/ https://accounts.google.com/ https://storage.googleapis.com https://docs.google.com https://drive.google.com https://calendar.google.com/; base-uri 'none'; report-uri https://csp.withgoogle.com/csp/kaggle/20201130;", '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?