Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/341.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google Reporting API v4凭据在从Google API&;下载凭据后仍然为空;服务(Python)_Python_Google Oauth_Google Analytics Api_Google Reporting Api - Fatal编程技术网

Google Reporting API v4凭据在从Google API&;下载凭据后仍然为空;服务(Python)

Google Reporting API v4凭据在从Google API&;下载凭据后仍然为空;服务(Python),python,google-oauth,google-analytics-api,google-reporting-api,Python,Google Oauth,Google Analytics Api,Google Reporting Api,在寻找了很多关于如何解决我的问题之后,最后我在这里问了一个问题 我是Google Reporting API v4的新手,尝试与我的Google Analytics连接,并使用Python。我在中创建了OAuth 2.0客户端ID。然后我下载client\u secret.json文件,并在这里使用教程示例 flow = client.flow_from_clientsecrets( CLIENT_SECRETS_PATH, scope=SCOPES, message

在寻找了很多关于如何解决我的问题之后,最后我在这里问了一个问题

我是Google Reporting API v4的新手,尝试与我的Google Analytics连接,并使用Python。我在中创建了OAuth 2.0客户端ID。然后我下载
client\u secret.json
文件,并在这里使用教程示例

  flow = client.flow_from_clientsecrets(
      CLIENT_SECRETS_PATH, scope=SCOPES,
      message=tools.message_if_missing(CLIENT_SECRETS_PATH))

  # Prepare credentials, and authorize HTTP object with them.
  # If the credentials don't exist or are invalid run through the native client
  # flow. The Storage object will ensure that if successful the good
  # credentials will get written back to a file.
  storage = file.Storage('analyticsreporting.dat')
  credentials = storage.get()
我的
凭证为无
。我不想使用自定义登录过程来登录它,因为我希望它更具动态性

我的问题:为什么我要获得我的凭证
,因为这些凭证看起来很好,因为我刚刚从Google API&Services下载?还有什么,我只是跳绳或做错了。此外,我还从我的Google Analytics帐户添加了
VIEW\u ID

需要帮助:请帮我弄清楚。也就是说,如何使用
client\u secret.json
文件并从\u clientsecrets()方法运行
client.flow\u来完成凭证过程。我不想使用
tools.run\u flow()
方法,因为它要求登录到帐户,而不可能与其他人共享我的Google帐户凭据