7

我正在使用谷歌日历 python api ( https://developers.google.com/google-apps/calendar/quickstart/python#step_3_set_up_the_sample ) 的示例脚本来尝试打印所有日历事件。但是我收到以下错误:

AttributeError: 'module' object has no attribute 'file'

从线

store = oauth2client.file.Storage(credential_path)

我在文档中找不到对此类错误的引用。有没有其他人遇到过这个?

干杯,杰克

4

1 回答 1

18

在原始样本中

https://developers.google.com/google-apps/calendar/quickstart/python#step_3_set_up_the_sample

缺少导入条目:

   from oauth2client import file 

添加此行并尝试再次运行您的脚本

于 2016-06-20T20:51:59.343 回答