好的,我正在学习“成为技术营销人员”课程,并尝试学习如何使用GSpread管理Google电子表格。我已经按照http://gspread.readthedocs.io/en/latest/oauth2.html上的文档进行了操作。我按照上面第二个URL中的步骤运行了一个包含以下代码的文档:
import gspread
from oauth2client.service_account import ServiceAccountCredentials
scope = ['https://spreadsheets.google.com/feeds']
credentials = ServiceAccountCredentials.from_json_keyfile_name('DFS Google Sheets Data Imports-7205de852ff7.json', scope)
gc = gspread.authorize(credentials)
wks = gc.open("Authority Scraper").sheet1
wks.update_cell(1,2,"Hello World!")
因此我在终端中得到以下错误:from oauth2client.service_account import ServiceAccountCredentials ImportError: No module named oauth2client.service_account
请有人帮帮我。其他“没有名为oath2client.service_account的模块”的答案对我没有用。谢谢!
pip install --upgrade oauth2client
是否没有出现错误? - Jacques Gaudin