Error when using cdstoolbox


I've been trying to retrieve some ERA5 data ( with cdstoolbox, however upon running my script I recieve this error:

2022-05-26 11:15:11,283 INFO Welcome to the CDS
2022-05-26 11:15:11,283 INFO Sending request to
2022-05-26 11:15:11,443 INFO Request is queued
2022-05-26 11:15:12,594 INFO Request is failed
2022-05-26 11:15:12,594 ERROR Message:
2022-05-26 11:15:12,594 ERROR Reason: Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/jsonrequest/", line 71, in jsonrequestcall
resp = coding.encode(req.callable(*req.args, **req.kwargs), register=encoders, **context)
File "/usr/local/lib/python3.6/dist-packages/cdsworkflows/", line 51, in submit_workflow
workflow_bare_func = runpy.run_path(workflow_path)[workflow_name]
KeyError: 'application'

And when importing the api:

Python 3.8.10 (default, Mar 15 2022, 12:22:08)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cdstoolbox
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jada/.local/lib/python3.8/site-packages/cdstoolbox/", line 8, in <module>
    with open(__main__.__file__) as f:
AttributeError: module '__main__' has no attribute '__file__'

If anyone has any suggestions as to how I can fix this, please let me know. Any help is appreciated.


Jada Lynch

Hi Jada,

Rather than running the Toolbox workflow on your local system, you would usually run your workflow in the Toolbox editor itself :


call the toolbox workflow as a service using the CDS API:

Call a service with the CDS API

Hope that helps,