使用Google Drive API时,IOError权限被拒绝

时间:2015-09-05 19:13:16

标签: python-2.7 oauth-2.0 google-drive-api

尝试获取写入Google表单的脚​​本

我得到的追溯结束是

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", 
line 520, in __init__
self._context.load_verify_locations(ca_certs)
IOError: [Errno 13] Permission denied

我按照http://gspread.readthedocs.org/en/latest/oauth2.html

中的步骤进行操作

不确定是什么。

__author__ = 'KirkLazarus'
import mechanize
import re
import gspread
import json
from oauth2client.client import SignedJwtAssertionCredentials
#import bs4 

br = mechanize.Browser()

    pagelist=["https://en.wikipedia.org/wiki/Tesla_Model_S",
          "https://en.wikipedia.org/wiki/Chevrolet_Volt",
          "https://en.wikipedia.org/wiki/Tesla_Roadster",
          "https://en.wikipedia.org/wiki/Nissan_Leaf",
          "https://en.wikipedia.org/wiki/Spark-Renault_SRT_01E",]
wheelbase = ''
length =''
width= ''
height =''

json_key = json.load(open('EVmodel-9d92f01d2cc0.json'))
scope = ['https://spreadsheets.google.com/feeds']

credentials = SignedJwtAssertionCredentials(json_key['client_email'],json_key['private_key'], scope)

gc = gspread.authorize(credentials)

wks = gc.open("EVModel").sheet1

1 个答案:

答案 0 :(得分:-1)

您是否尝试使用sudo运行代码?