I can't execute the code, because I get the following error error:ModuleNotFoundError: No module named 'apiclient.http'
.
Module apiclient
, is installed and this is my code:
from __future__ import print_function
import getpass
from googleapiclient.discovery import build
from httplib2 import Http
from oauth2client import file, client, tools
from apiclient.http import MediaFileUpload
import time
import os.path
archivos = input(str("Introduce como quieres que se llame ese archivo en la nube. INCLUYENDO LA
EXTENSIÓN DEL ARCHIVO----> "))
extension = os.path.splitext(archivos)
Extension = extension[1]
print (Extension[1])
if Extension == ".jpg":
Extension = 'image/jpg'
# If modifying these scopes, delete the file token.json.
SCOPES = 'https://www.googleapis.com/auth/drive'
User = getpass.getuser()
print ("---------------------------------------------------------")
print (" PROGRAMA PARA SUBIR ")
print ("---------------------------------------------------------")
time.sleep(1)
store = file.Storage('token.json')
creds = store.get()
drive = (build('drive', 'v3', http=creds.authorize(Http())))
file_metadata = {'name': extension }
media = MediaFileUpload('C:/Users/' + User + '/Desktop/' + input(str("¿Como se llama el archivo q
quieres subir? (Carpeta donde tiene que estar el archivo es el escritorio)-----> ")),
mimetype= Extension)
time.sleep(0.5)
file = drive.files().create(body=file_metadata,
media_body=media,
fields='id').execute()