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

后端 未结 8 1757
孤城傲影
孤城傲影 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:55

    I did not want to downgrade my oauth2client. You can use oauth2client 4.1.2 when you set cache_discovery=False for apiclient.discovery.build. This simple solution silenced the error:

    service = discovery.build(api_name, 
                              api_version, 
                              credentials=credentials, 
                              cache_discovery=False)
    

    Source

提交回复
热议问题