我正在使用 google calendars 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)
我在文档中找不到对此类错误的引用。有没有其他人以前遇到过这个问题?
干杯, jack
最佳答案
在原始样本中
https://developers.google.com/google-apps/calendar/quickstart/python#step_3_set_up_the_sample
缺少导入条目:
from oauth2client import file
添加这一行并尝试再次运行您的脚本
关于python - '属性错误 : 'module' object has no attribute 'file' ' when using oauth2client with Google Calendar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37002110/