ImportError: No module named oauth2client我最初的想法是有一些冲突,所以我卸载了两个程序,并单独安装了google python。这应该能解决任何冲突吗?仍然没有joy。Running setup.py (path:C:\Users\078861~1.025\AppData\Local\Temp\pip_build_07886187\oauth2clien
oauth2client.service_account import ServiceAccountCredentials File "/usr/local/lib/python2.7/dist-packages/oauth2client/service_account.py", line 26, in <module>
from oauth2client import crypt File "/usr/loca
var tokenClient = new OAuth2Client(new Uri("https://myServer/myIdentityServer/connect/token"), "clientId我直接把这两个参数给了OAuth2Client构造函数,我是不是做错了什么?
更新:按照Scott的建议,我也尝试使用来自IdentityModel的IdentityModel类。
我正在使用google的驱动API构建一个应用程序,我使用的是一个JSON密钥。每当我运行以下代码时:scope = ['https://spreadsheets.google.com/spreadsheets']client = gspread.authorize(creds) # this connects the the google api
\Lib\site-packages\oauth2client\client.py:33: Cannot find 'six.moves' in package 'oauth2client' as absolute' in package 'oauth2client' as absolute import.'oauth2client' as absolute import.' in package 'oau
但是,由于每个API调用都必须得到授权,所以我创建了一个单独的文件和函数,它读取凭据,并应该返回要导出的授权oAuth2Client对象,并在需要作为参数传递的任何函数中重用。其思想是,readCredentials()函数调用将调用authorize()函数,如果存在token.json,则该函数将返回oAuth2Client对象。redirect_uris[0] if (err) return getAccessToken(oAuth