title: Trying to access google spreadsheet python, can't get credentials
body: <p>I'm trying to send data to google spreadsheet by python. Many tutorials later, I got stuck with the following error.</p>
  
  <p>When I run this Python code:</p>
  
  <pre><code>from oauth2client.client import OAuth2WebServerFlow
  from oauth2client.tools import run_flow
  from oauth2client.file import Storage
  from oauth2client.tools import argparser
  
  CLIENT_ID = 'xxxxxxxgleusercontent.com'
  CLIENT_SECRET = 'xxxxxxxxx'
  
  
  flow = OAuth2WebServerFlow(
  client_id = CLIENT_ID,
  client_secret = CLIENT_SECRET,
  scope = 'https://spreadsheets.google.com/feeds https://docs.google.com/feeds',
            redirect_uri = 'http://example.com/auth_return'
  )
  
  flags = argparser.parse_args(args=[])
  storage = Storage('creds.data')
  credentials = run_flow(flow, storage, flags)
  print "access_token: %s" % credentials.access_token
  </code></pre>
  
  <p>I get this (which is fine)</p>
  
  <p><a href="http://static.indjango.com/python-gspread/screen-8.png" rel="nofollow">http://static.indjango.com/python-gspread/screen-8.png</a>   (not allowed to post pics yet)</p>
  
  <p>Problem:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/home/pi/Desktop/gs/gs.py", line 43, in &lt;module&gt;
      credentials = run_flow(flow, storage, flags)
    File "/usr/local/lib/python2.7/dist-packages/oauth2client/util.py", line 135, in positional_wrapper
      return wrapped(*args, **kwargs)
    File "/usr/local/lib/python2.7/dist-packages/oauth2client/tools.py", line 235, in run_flow
      credential = flow.step2_exchange(code, http=http)
    File "/usr/local/lib/python2.7/dist-packages/oauth2client/util.py", line 135, in positional_wrapper
      return wrapped(*args, **kwargs)
    File "/usr/local/lib/python2.7/dist-packages/oauth2client/client.py", line 2102, in step2_exchange
      headers=headers)
    File "/usr/local/lib/python2.7/dist-packages/httplib2/__init__.py", line 1609, in request
      (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
    File "/usr/local/lib/python2.7/dist-packages/httplib2/__init__.py", line 1351, in _request
      (response, content) = self._conn_request(conn, request_uri, method, body, headers)
    File "/usr/local/lib/python2.7/dist-packages/httplib2/__init__.py", line 1272, in _conn_request
      conn.connect()
    File "/usr/local/lib/python2.7/dist-packages/httplib2/__init__.py", line 1059, in connect
      raise SSLHandshakeError(e)
  SSLHandshakeError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)
  </code></pre>
  
  <p>What can I do to fix this?</p>
  
  <p><a href="http://www.indjango.com/access-google-sheets-in-python-using-gspread/" rel="nofollow">This</a> particular tutorial.</p>