ImportError: não é possível importar o nome SignedJwtAssertionCredentials
Estou tentando acessar um aplicativo do Google por meio do Python Client usando esse código para obter autorização (informações privadas obviamente editadas):
import gflags
import httplib2
from apiclient.discovery import build
from oauth2client.file import Storage
from oauth2client.client import SignedJwtAssertionCredentials
from oauth2client.tools import run
f = open('privatekey.p12', 'rb')
key = f.read()
f.close()
credentials = SignedJwtAssertionCredentials(
service_account_name='[email protected]',
private_key=key,
scope = 'https://www.googleapis.com/auth/calendar')
http = httplib2.Http()
http = credentials.authorize(http)
service = build(serviceName='calendar', version='v3', http=http)
Ainda recebo este erro:
ImportError: cannot import name SignedJwtAssertionCredentials
Instalei o cliente Python da API do Google v3 e o OAuth2; Eu não pareço ter nenhum outro problema com esses módulos, embora eu não tenha usado muito. Alguém sabe o que está acontecendo?