Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/09/2014, 04:52
SARGE553413
 
Fecha de Ingreso: febrero-2014
Mensajes: 55
Antigüedad: 10 años, 2 meses
Puntos: 3
Error al acceder a Google Drive con Python

Hola a todos.

Estoy intentando aprender a acceder a Google Drive desde Python pero tengo problemas.

He seguido el tutorial de la web oficial de google: https://developers.google.com/drive/...t-python?hl=es

Os digo los pasos que he seguido literalmente:
1 - Instalar la herramienta pip para instalar el SDK de Google.
2 - Instalar el SDK de Google: "pip install --upgrade google-api-python-client"
En este paso todo va bien, de hecho al hacer los imports etc. no hay ningún fallo.
3 - Activar la API de Drive:
Sigo los pasos tal cual, creo un "client ID for native application" y un "client ID for web
application"
4 - Creo del documento "document.txt" y copio el código fuente de quickstart tal cual.
5 - Sustituyo "CLIENT_ID" y "CLIENT_SECRET" por los que aparecen en "Client id ofr native application" (también he probado con web application)
6 - Ejecuto, y la salida por pantalla es:
Código:
No handlers could be found for logger "oauth2client.util"
Go to the following link in your browser:
<un link largo>
Enter verification code:
He buscado bastante una solución, no la he encontrado pero añadiendo al código:
Código:
import logging
...
logging.basicConfig()
El error resultante es:
Código:
C:\workspaces\asd\prsGoogleApi>quickstart.py
WARNING:oauth2client.util:__init__() takes at most 4 positional arguments (5 giv
en)
Go to the following link in your browser:
<un link largo>
Enter verification code:
7 - Aún así, intento acceder a la web que aparece, y el error es:
Código:
401 - That's an error
Error: invalid_client.
No application name.

Request details:
response_type=code
scope=https://www.googleapis.com/auth/drive
access_type=offline
redirect_uri=urn:ietf:wg:oauth:2.0:oob
client_id=...
No se qué he hecho mal o que me he dejado, pero no hay manera de hacerlo funcionar.

¿Alguien puede ayudarme por favor?

Saludos, gracias.