title: Google Sheets API Won't Authorize - Python
body: <p>Hi StackOverflow Community,</p>
  
  <p>Thanks in advance for your help.</p>
  
  <p>I have set up a Python script to make some requests to the Google Sheets API. The code for my script is below:</p>
  
  <pre><code>from googleapiclient import discovery
  credentials ='https://www.googleapis.com/auth/spreadsheets' #Should give read/write scope to my spreadsheets
  service = discovery.build('sheets', 'v4', credentials=credentials) 
  
  spreadsheet_id ='1z2QzPf9Kc02roOwTJUYab4k2dwYu1n-nIbJ5yzWF3YE' #COPY
  ranges=['A1:C10']
  include_grid_data = False
  request = service.spreadsheets().get(spreadsheetId=spreadsheet_id,
  ranges=ranges, includeGridData=include_grid_data)
  response = request.execute()
  </code></pre>
  
  <p>The problem is that when I run this I get the following error:</p>
  
  <pre><code>File "C:\Users\evank\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\googleapiclient\_auth.py", line 92, in authorized_http
   return credentials.authorize(build_http())
  
  builtins.AttributeError: 'str' object has no attribute 'authorize'
  </code></pre>
  
  <p>The full code of this file listed in the error is located here: <a href="https://github.com/google/google-api-python-client/blob/master/googleapiclient/_auth.py" rel="nofollow noreferrer">https://github.com/google/google-api-python-client/blob/master/googleapiclient/_auth.py</a></p>
  
  <p>I'm working on this for an assignment and can't figure out why this error is occurring. Please help!</p>
  
  <p>Thanks,</p>
  
  <p>evank28</p>