Google OAuth AttributeError:“'module'对象没有属性'docs'”

时间:2011-09-11 03:17:23

标签: python oauth

我正在尝试使用Google服务设置OAuth。按照示例here,我正在使用:

try:
  from xml.etree import ElementTree
except ImportError:
  from elementtree import ElementTree
import gdata.calendar.data
import gdata.calendar.client
import gdata.acl.data
import gdata
import atom
import getopt
import sys
import string
import time

CONSUMER_KEY = "xxx"
CONSUMER_SECRET = "xxx"
TOKEN = "xxx"
TOKEN_SECRET = "xxx"

client = gdata.docs.client.DocsClient(source='xxx')

当Python尝试创建客户端时抛出AttributeError: "'module' object has no attribute 'docs'"

1 个答案:

答案 0 :(得分:2)

import编辑gdata但不是gdata.docs.client。将其添加到import的剩余部分:

import gdata.docs.client