0

I'm trying to upload a file to drive using a script. I'm running on python 3.7.9

import os
from Google import Create_Service
from googleapiclient.http import MediaFileUpload

CLIENT_SECRET_FILE = 'google-auth.json'
API_NAME = 'drive'
API_VERSION = 'v3'
SCOPES = ['https://www.googleapis.com/auth/drive']
FILE = 'file.pdf'

service = Create_Service(CLIENT_SECRET_FILE, API_NAME, API_VERSION, SCOPES)

but I'm getting this

ModuleNotFoundError: No module named 'Google'

Also I've referred to other answers on the same issue, I tried them but still gives me the same error. I've installed required google modules.

google==3.0.0
google-api-core==1.30.0
google-api-python-client==2.12.0
google-auth==1.31.0
google-auth-httplib2==0.1.0
google-auth-oauthlib==0.4.4
google-cloud==0.34.0
google-cloud-bigquery==2.20.0
google-cloud-core==1.6.0
google-cloud-storage==1.38.0
google-crc32c==1.1.2
google-resumable-media==1.3.0
googleapis-common-protos==1.53.0

What am I missing here?

Karl Knechtel
  • 56,349
  • 8
  • 83
  • 124
  • 3
    There is a huge difference between `Google` and `google`. Spelling matters. – Tim Roberts Jul 08 '21 at 04:36
  • @TimRoberts I've tried that too. But ending up with `from google import Create_Service ImportError: cannot import name 'Create_Service' from 'google' (unknown location)` – NiKhil GarakaPati Jul 08 '21 at 04:43
  • https://stackoverflow.com/a/53901668/4233629 – Sush Jul 08 '21 at 04:55
  • 1
    Right, because now you have the correct name for the module, but that module doesn't have anything in it called `Create_Service`. Please read the documentation and make sure you are correctly spelling and capitalizing *that*. – Karl Knechtel Jul 08 '21 at 06:13
  • As an aside: I have removed the `python-requests` tag from this question. That is **not** for "I have a request concerning my Python code"; `python` already covers that. `python-requests` is for a specific Python library named `requests` that is used for downloading from the WWW. – Karl Knechtel Jul 08 '21 at 06:14

1 Answers1

1

You can try by upgrading the google-api-client package

pip install --upgrade google-api-python-client
Manglu
  • 256
  • 2
  • 9