Hi, I am trying to run the following example (derived from a much more complex script), but it does not work. The script itself worked last month.
import cdsapi
import os
c = cdsapi.Client()
c.retrieve(
‘cams-global-reanalysis-eac4’,
{
‘format’: ‘netcdf’,
‘variable’: [‘t2m’],
‘model_level’: ‘60’,
‘date’: ‘2020-01-01/2020-12-31’,
‘time’: [ ‘00:00’, ‘03:00’, ‘06:00’, ‘09:00’, ‘12:00’, ‘15:00’,‘18:00’, ‘21:00’,],
‘area’: [56, 6, 38, 34,],
},
‘./test.nc’).download()
My .cdsapirc file looks like this:
url: https://ads.atmosphere.copernicus.eu/api
key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
However, I got the following error (it looks like it has to do with access):
2024-10-16 16:52:58,889 INFO Sending request to https://ads.atmosphere.copernicus.eu/api/resources/cams-global-reanalysis-eac4
Traceback (most recent call last):
File “simple_test_01.py”, line 5, in
c.retrieve(
File “/work/users/aca/anaconda3/envs/ClimPol05_CAMS/lib/python3.8/site-packages/cdsapi/api.py”, line 280, in retrieve
result = self._api(‘%s/resources/%s’ % (self.url, name), request)
File “/work/users/aca/anaconda3/envs/ClimPol05_CAMS/lib/python3.8/site-packages/cdsapi/api.py”, line 295, in _api
result = self.robust(session.post)(url,
File “/work/users/aca/anaconda3/envs/ClimPol05_CAMS/lib/python3.8/site-packages/cdsapi/api.py”, line 413, in wrapped
r = call(*args, **kwargs)
File “/work/users/aca/anaconda3/envs/ClimPol05_CAMS/lib/python3.8/site-packages/requests/sessions.py”, line 578, in post
return self.request(‘POST’, url, data=data, json=json, **kwargs)
File “/work/users/aca/anaconda3/envs/ClimPol05_CAMS/lib/python3.8/site-packages/requests/sessions.py”, line 516, in request
prep = self.prepare_request(req)
File “/work/users/aca/anaconda3/envs/ClimPol05_CAMS/lib/python3.8/site-packages/requests/sessions.py”, line 449, in prepare_request
p.prepare(
File “/work/users/aca/anaconda3/envs/ClimPol05_CAMS/lib/python3.8/site-packages/requests/models.py”, line 318, in prepare
self.prepare_auth(auth, url)
File “/work/users/aca/anaconda3/envs/ClimPol05_CAMS/lib/python3.8/site-packages/requests/models.py”, line 549, in prepare_auth
r = auth(self)
TypeError: ‘tuple’ object is not callable
Any help welcome
Cheers and thanks