“ImportError: file_cache is unavailable” when using Python client for Google service account file_cache

后端 未结 8 1912
孤城傲影
孤城傲影 2021-01-30 16:03

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

8条回答
  •  轮回少年
    2021-01-30 16:57

    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.

提交回复
热议问题