# Install the PyDrive wrapper & import libraries.
# This only needs to be done once in a notebook.
!pip install -U -q PyDrive
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
from google.colab import auth
from oauth2client.client import GoogleCredentials
# Authenticate and create the PyDrive client.
# This only needs to be done once in a notebook.
auth.authenticate_user()
gauth = GoogleAuth()
gauth.credentials = GoogleCredentials.get_application_default()
drive = GoogleDrive(gauth)
# Create & upload a file.
uploaded = drive.CreateFile({'title': './strt4_80im'})
uploaded.SetContentFile('strt4_80im')
uploaded.Upload()
print('Uploaded file with ID {}'.format(uploaded.get('id')))
but got the error :
(...)
1692 # Fix-up relative redirects (which violate an RFC 2616 MUST)
RedirectMissingLocation: Redirected but the response is missing a Location: header.
please help me !
thank you :)
bye