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

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

    I am a bit late to the party here but I had a similar problem today and found the answer here

    Solution to only the error : file_cache is unavailable when using oauth2client >= 4.0.0

    Solution:

    change your discovery.build() to have the field cache_discovery=False i.e

    discovery.build(api, version, http=http, cache_discovery=False)
    

    EDIT:

    As @Chronial says this will disable the cache.

    A solution that does not disable the cache can be found here

提交回复
热议问题