我使用gspread将我的应用程序连接到电子表格,为此我使用以下代码
import json
import gspread
from oauth2client.client import SignedJwtAssertionCredentials
json_key = json.load(open('service_account.json'))
scope = ['https://spreadsheets.google.com/feeds']
credentials = SignedJwtAssertionCredentials(json_key['client_email'], json_key['private_key'], scope)
gc = gspread.authorize(credentials)
sheet = gc.open('Order Database').sheet1
当我在idle中使用它来访问电子表格。但是当我在我的应用程序的代码中使用它时,我正在使用googleappengine,当我运行应用程序并尝试访问页面时,我得到了这个错误
^{pr2}$我甚至成功地在项目目录中安装了库:
pip install -t lib PyOpenSSL
pip install -t lib gspread
pip install -t lib oauth2client
pip install -t lib cryptography
我甚至试着将--upgrade
添加到其中的每一个,并且所有的安装都成功,但是得到了相同的错误
如果我做错了什么,请告诉我,我该如何解决这个问题?在
提前谢谢。在
好吧,我终于解决了这个问题。我只需要在
app.yaml
中添加以下内容:相关问题 更多 >
编程相关推荐