Unable to run script despite migrating to new CDS API

Suggestion 1:

  • Update the cdsapi package!

Suggestion 2:
Provide the key in an alternative way:

This indicates that the key is incorrect. You could try the following within your code (not neat & don’t commit to git, but quick fix):

import os

# Set the API credentials as environment variables
os.environ['CDSAPI_URL'] = 'https://cds.climate.copernicus.eu/api/v2'
os.environ['CDSAPI_KEY'] = 'your_api_key_here'

See also this post on other versions of this suggestion: https://forum.ecmwf.int/t/is-there-elsewhere-to-put-the-cdsapirc-file-running-it-on-databricks/956