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

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

    Fwiw this is a reposting of my answer here

    Since they are technically warnings (not errors), if you don't have direct access to the call, you can do this wherever you instantiate the service to suppress them:

    import logging logging.getLogger('googleapiclient.discovery_cache').setLevel(logging.ERROR)

    With thanks to theacodes who gave that answer here (but with a missing 'n' in 'client' that seems to have led to a lot of downvotes there).

    See also the discussion here

提交回复
热议问题