簡體   English   中英

實施Hello Analytics API時發生Python錯誤

[英]Python Error when implementing Hello Analytics API

基本上,我遵循以下教程:

https://developers.google.com/analytics/solutions/articles/hello-analytics-api#introduction

老實說,即使逐步學習了本教程,我也不知道自己在做什么。

當我實現所有這些代碼時,一切正常,直到我hello_analytics_api_v3.py添加到腳本hello_analytics_api_v3.py

if __name__ == '__main__':
  main(sys.argv)

我收到以下錯誤,我不知道這意味着什么。

Traceback (most recent call last):
  File "/Users/Python Projects/hello_analytics_api_v3.py", line 83, in <module>
    main(sys.argv)
  File "/Users/Python Projects/hello_analytics_api_v3.py", line 15, in main
    service = hello_analytics_api_v3_auth.initialize_service()
  File "/Users/Python Projects/hello_analytics_api_v3_auth.py", line 39, in initialize_service
    credentials = prepare_credentials()
  File "/Users/Python Projects/hello_analytics_api_v3_auth.py", line 32, in prepare_credentials
    credentials = run(FLOW, storage)
  File "build/bdist.macosx-10.9-intel/egg/oauth2client/tools.py", line 241, in run
NotImplementedError: The gflags library must be installed to use tools.run(). Please install gflags or preferrably switch to using tools.run_flow().

有人可以告訴我出了什么問題嗎?

安裝gflags庫:

pip install --upgrade python-gflags

要么

easy_install --upgrade python-gflags

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM