I\'m using a service account for G Suite with full domain delegation. I have a script with readonly access to Google Calendar. The script works just fine, but throws an error (o
To use the Google API for Python client, you need to install it first as Google API is not built-in within the Python modules. The instruction is found in Install the Library.
Installation
You can either use a package manager or download and install the Python client library manually:
Managed installation
Use pip or setuptools to manage your installation (you might need to run sudo first):
pip (preferred):
$ pip install --upgrade google-api-python-client
Setuptools: Use the easy_install tool included in the setuptools package:
$ easy_install --upgrade google-api-python-client
Here is how I use google-api-python-client
to build a service on Cloud Functions.
# for Cloud Functions use
def get_service():
import googleapiclient.discovery
return googleapiclient.discovery.build('compute', 'v1', cache_discovery=False)
And finally it worked.