...
https://pypi.org/project/ecmwf-api-client/
Briefly, install this with the pip command:
- pip install ecmwf-api-client
You will now have the modules needed in the python scripts. (I actually needed this on the ECMWF system pip install --user ecmwf-api-client).
Login and retrieve your "key":
...