繁体   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