[英]How to distribute a MacOS Disk Image (DMG) file to other Macs? Uploading to Google Drive or AwsS3 corrupts the file
[英]Uploading file to Google Drive Via Python
參考: https://pythonhosted.org/PyDrive/步驟 1)https://pythonhosted.org/PyDrive/quickstart.html#authentication在本地 fs 工作目錄中創建“client_secrets.json”。
from pydrive.auth import GoogleAuth
gauth = GoogleAuth()
gauth.LocalWebserverAuth()
錯誤:InvalidClientSecretsError Traceback(最近一次調用)/opt/conda/lib/python3.6/site-packages/pydrive/auth.py in LoadClientConfigFile(self, client_config_file) 385 try: --> 386 client_type, client_info = clientsecrets. loadfile(client_config_file) 387 除了 clientsecrets.InvalidClientSecretsError 作為錯誤:..... /opt/conda/lib/python3.6/site-packages/pydrive**/auth.py** 在 LoadClientConfigFile(self, client_config_file) 386 client_type , client_info = clientsecrets.loadfile(client_config_file) 387 except clientsecrets.InvalidClientSecretsError as error: --> 388 raise InvalidConfigError('Invalid client secrets file %s' % error) 389 如果不是 client_type in (clientsecrets.TYPE_WEB, 390 clientsecrets.TYPE_INSTALLED) :
InvalidConfigError:客戶端機密文件無效,客戶端類型“web”中缺少屬性“redirect_uris” 。
嘗試過
gauth = GoogleAuth()
credential_file = 'client_secrets.json'
gauth.LoadCredentialsFile(credential_file)
gauth = GoogleAuth()
gauth.LocalWebserverAuth()
gauth.SaveCredentialsFile(credential_file)
2 credential_file = 'client_secrets.json' #'../input/gdriveauth/client_secret_259511041847-no6nt8ennhbccaoqhv98ucsccv3hglu7.apps.googleusercontent.com.json' 3 #gauth.LoadCredentialsFile() 中的錯誤KeyError Traceback(最近調用最后一次) -> 4 gauth.LoadCredentialsFile(credential_file) ...
/opt/conda/lib/python3.6/site-packages/oauth2client/ client.py in new_from_json(cls, json_data) 300 # 找到並調用正確的類方法 from_json() 來恢復 301 # object. --> 302 module_name = data['_module'] 303 嘗試:304 module_obj = import (module_name)
鍵錯誤:'_module'
您創建並下載了錯誤類型的憑據文件。
在console.cloud.google.com創建憑據時,您需要選擇“桌面”而非“Web”應用程序類型。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.