Problem connection to CDS

Hi,
I cannot connect to the CDS and I am not sure why.

Here is the error:
2025-02-13 12:51:43,359 INFO [2024-09-26T00:00:00] Watch our Forum for Announcements, news and other discussed topics.
2025-02-13 12:51:43,360 WARNING [2024-06-16T00:00:00] CDS API syntax is changed and some keys or parameter names may have also changed. To avoid requests failing, please use the “Show API request code” tool on the dataset Download Form to check you are using the correct syntax for your API request.
Failed to delete temp file D:\ETERRE~1\AppData\Local\Temp\d5369957a5be15735b13a6a0df9566849b3b7ef2579aa954 with error [WinError 2] Le fichier spécifié est introuvable: ‘D:\ETERRE~1\AppData\Local\Temp\d5369957a5be15735b13a6a0df9566849b3b7ef2579aa954’

Here is the full error:
2025-02-20 17:01:05,039 INFO [2024-09-26T00:00:00] Watch our Forum for Announcements, news and other discussed topics.
2025-02-20 17:01:05,039 WARNING [2024-06-16T00:00:00] CDS API syntax is changed and some keys or parameter names may have also changed. To avoid requests failing, please use the “Show API request code” tool on the dataset Download Form to check you are using the correct syntax for your API request.


HTTPError Traceback (most recent call last)
Cell In[13], line 18
6 request = {
7 ‘product_type’: [‘reanalysis’],
8 ‘variable’: [‘geopotential’],
(…)
14 ‘data_format’: ‘grib’,
15 }
16 target = ‘download.grib’
—> 18 client.retrieve(dataset, request, target)

File ~\anaconda3\Lib\site-packages\datapi\legacy_api_client.py:169, in LegacyApiClient.retrieve(self, name, request, target)
167 submitted: Remote | Results
168 if self.wait_until_complete:
→ 169 submitted = self.client.submit_and_wait_on_results(
170 collection_id=name,
171 **request,
172 )
173 else:
174 submitted = self.client.submit(
175 collection_id=name,
176 **request,
177 )

File ~\anaconda3\Lib\site-packages\datapi\api_client.py:458, in ApiClient.submit_and_wait_on_results(self, collection_id, **request)
442 def submit_and_wait_on_results(
443 self, collection_id: str, **request: Any
444 ) → datapi.Results:
445 “”“Submit a request and wait for the results to be ready.
446
447 Parameters
(…)
456 datapi.Results
457 “””
→ 458 return self._retrieve_api.submit(collection_id, **request).make_results()

File ~\anaconda3\Lib\site-packages\datapi\processing.py:727, in Processing.submit(self, collection_id, **request)
726 def submit(self, collection_id: str, **request: Any) → Remote:
→ 727 return self.get_process(collection_id).submit(**request)

File ~\anaconda3\Lib\site-packages\datapi\processing.py:319, in Process.submit(self, **request)
307 def submit(self, **request: Any) → datapi.Remote:
308 “”“Submit a request.
309
310 Parameters
(…)
317 datapi.Remote
318 “””
→ 319 job = Job.from_request(
320 “post”,
321 f"{self.url}/execution",
322 json={“inputs”: request},
323 **self._request_kwargs,
324 )
325 return job.make_remote()

File ~\anaconda3\Lib\site-packages\datapi\processing.py:177, in ApiResponse.from_request(cls, method, url, headers, session, retry_options, request_options, download_options, sleep_max, cleanup, log_callback, log_messages, **kwargs)
172 response = robust_request(
173 method, url, headers=headers, **request_options, **kwargs
174 )
175 log(logging.DEBUG, f"REPLY {response.text}", callback=log_callback)
→ 177 cads_raise_for_status(response)
179 self = cls(
180 response,
181 headers=headers,
(…)
188 log_callback=log_callback,
189 )
190 if log_messages:

File ~\anaconda3\Lib\site-packages\datapi\processing.py:100, in cads_raise_for_status(response)
93 else:
94 message = “\n”.join(
95 [
96 f"{response.status_code} Client Error: {response.reason} for url: {response.url}",
97 error_json_to_message(error_json),
98 ]
99 )
→ 100 raise requests.HTTPError(message, response=response)
101 response.raise_for_status()

HTTPError: 403 Client Error: Forbidden for url: https://cds.climate.copernicus.eu/api/retrieve/v1/processes/reanalysis-era5-pressure-levels/execution
required licences not accepted
Not all the required licences have been accepted; please visit ERA5 hourly data on pressure levels from 1940 to present to accept the required licence(s).

and the code used:

import cdsapi

client = cdsapi.Client()

dataset = ‘reanalysis-era5-pressure-levels’
request = {
‘product_type’: [‘reanalysis’],
‘variable’: [‘geopotential’],
‘year’: [‘2024’],
‘month’: [‘03’],
‘day’: [‘01’],
‘time’: [‘13:00’],
‘pressure_level’: [‘1000’],
‘data_format’: ‘grib’,
}
target = ‘download.grib’

client.retrieve(dataset, request, target)

Hi,
did you accept the license on the web page of the relevant dataset as stated in the error?

Not all the required licences have been accepted; please visit ERA5 hourly data on pressure levels from 1940 to present to accept the required licence(s).

Thanks