1 year ago

#251818

test-img

thereiswaldo

CDS data request (incomplete config file)

I am trying to request data from CDS using a python script. I have installed python3 and the CDS api as outlined in https://confluence.ecmwf.int/display/CKB/How+to+install+and+use+CDS+API+on+macOS

However, when running the following script:

#!/usr/bin/env python
import cdsapi
c = cdsapi.Client()
c.retrieve("reanalysis-era5-pressure-levels",
{
"variable": "temperature",
"pressure_level": "1000",
"product_type": "reanalysis",
"year": "2008",
"month": "01",
"day": "01",
"time": "12:00",
"format": "grib"
}, "download.grib")

The following error pops:

Traceback (most recent call last):
  File "ecmwf.py", line 3, in <module>
    c = cdsapi.Client()
  File "/Users/username/Library/Python/3.8/lib/python/site-packages/cdsapi/api.py", line 301, in __init__
    raise Exception("Missing/incomplete configuration file: %s" % (dotrc))
Exception: Missing/incomplete configuration file: /Users/username/.cdsapirc

This script is saved in my home (user) folder on MAC.

How to solve this?

python

grib

0 Answers

Your Answer

Accepted video resources