I'm trying to use Google Sheets with Python. I went to their quickstart tutorial and have been trying to get it to run for quite some time behind a company proxy. I'm on Windows 7, and I've changed the HTTP_PROXY and HTTPS_PROXY environment variables appropriately and have also tried setting them in the command prompt prior to running the code. Code is below and error it spits out is below that:
from apiclient.discovery import build
from httplib2 import Http
from oauth2client import file, client, tools
SCOPES = 'https://www.googleapis.com/auth/spreadsheets'
CLIENT_SECRET = 'client_secret.json'
store = file.Storage('storage.json')
credz = store.get()
if not credz or credz.invalid:
flow = client.flow_from_clientsecrets(CLIENT_SECRET, SCOPES)
credz = tools.run_flow(flow, store) #ERROR ON THIS LINE
Error1:
File "C:\Users\myusername\AppData\Local\Programs\Python\Python35\lib\socket.py",
line 732, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno 11004] getaddrinfo failed
Then it spits out "During handling of the above exception, another exception occurred:"
File
"C:\Users\myusername\AppData\Local\Programs\Python\Python35\lib\site-packages\httplib2__init__.py",
line 994, in _conn_request
raise ServerNotFoundError("Unable to find the server at %s" % conn.host) httplib2.ServerNotFoundError: Unable to find the server at
accounts.google.com