【发布时间】:2015-12-07 21:02:41
【问题描述】:
我在运行 iPython 笔记本中的代码时遇到了问题。这是运行的代码:
import pandas.io.ga as ga
import gflags
df = ga.read_ga(['visits', 'avgTimeOnSite'],
dimensions=['date', 'hour'],
start_date='2012-10-25')
这是由此产生的错误:
C:\Users\bdoherty\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\io\auth.pyc in authenticate(flow, storage)
106 credentials = storage.get()
107 if credentials is None or credentials.invalid:
--> 108 credentials = tools.run_flow(flow, storage)
109
110 http = credentials.authorize(http)
AttributeError: 'module' object has no attribute 'run'
查看 auth.py 的源代码,没有定义函数 run(),但有一个 run_flow 函数,这里有什么问题,为什么它试图调用 run()。如果这是一个明显的问题,请提前道歉,只是开始使用 GA 和 python
【问题讨论】:
标签: python google-analytics ipython google-api-python-client