Python中文
首页
教程
问答
标签
搜索
登录
注册
导入错误:Google Analytics API授权
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>我正在尝试运行此处提供的示例<a href="https://developers.google.com/analytics/devguides/reporting/core/v3/quickstart/service-py" rel="nofollow noreferrer">https://developers.google.com/analytics/devguides/reporting/core/v3/quickstart/service-py</a>以获得授权。</p> <p>我从中的其他问题注意到(<a href="https://stackoverflow.com/questions/14063124/importerror-cannot-import-name-signedjwtassertioncredentials">ImportError: cannot import name SignedJwtAssertionCredentials</a>)SignedJwtAssertionCredentials已被删除,因此无法导入。</p> <p>因此,我开始遵循GitHub页面(<a href="https://github.com/google/oauth2client/issues/401" rel="nofollow noreferrer">https://github.com/google/oauth2client/issues/401</a>)和StackOverflow上提供的解决方案。到目前为止,一切都没起作用,我仍然看到同样的错误。下面是我的代码。</p> <pre><code>import argparse from apiclient.discovery import build from oauth2client.service_account import ServiceAccountCredentials import httplib2 from oauth2client import client from oauth2client import file from oauth2client import tools </code></pre> <p>这就是我在运行上述代码时收到的错误。</p> <pre><code>ImportError: cannot import name ServiceAccountCredentials </code></pre> <p>由于我是这个领域的新手,所以我尝试对两个版本的<code>OAuth</code>(2.0.0和1.5.2)都这样做。我在安装<code>pyopenssl</code>之后也尝试过,但仍然失败。</p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>安装<code>pyopenssl</code>解决了我的问题:</p> <pre><code>pip install pyopenssl </code></pre> <p>基于<a href="https://stackoverflow.com/a/28872094/1224827">this answer.</a></p>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
如何测试setup.py?
7 回答
如何测试Singleton\u del\u()方法?
8 回答
如何测试slack api团队加入活动
6 回答
如何测试soapweb服务的RPC?
4 回答
如何测试SocketIO服务器连接(使用pytest或任何其他包)?
3 回答
如何测试stanfordnlp是否在gpu上运行?
8 回答
如何测试stdin脚本“live”,通常程序在后台与之交互?
5 回答
如何测试tensorflow cifar10 cnn tutorial mod
1 回答
如何测试Tkinter标签调用
2 回答
如何测试Tornado处理程序正确调用另一个API?
10 回答
如何测试unittests中引发的命名CheckConstraint或ValidationError?
8 回答
如何测试URL是否被调用(从另一个线程内部)
3 回答
如何测试uuuu name_uuuuuuu==“uuuuuu main_uuuuuuuuuuuuuu”以增加覆盖率
7 回答
如何测试WindowStaysOnTopHint标志是否设置在windowFlags中?
7 回答
如何测试X是否像list/tup那样嘎嘎作响
7 回答
如何测试x是否是一个泛集的成员?
5 回答
如何测试一个numpy中的所有行是否相等
1 回答
如何测试一个Python对象是否为模块?
7 回答
如何测试一个函数,它返回的东西,并有副作用?
5 回答
如何测试一个函数只接受某个类型?
3 回答