title: Why do I get credential read in error on google slide API?
body: <p>I downloaded the gsuite developers python code from :</p>
  
  <p>(<a href="https://github.com/gsuitedevs/python-samples" rel="nofollow noreferrer">https://github.com/gsuitedevs/python-samples</a>)</p>
  
  <p>I then enabled api access and downloaded the credentials.json file and ran the quickstart.py in:</p>
  
  <p>(python-samples-master/slides/quickstart) and it worked and outputted</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>The presentation contains 5 slides:
  - Slide #1 contains 4 elements.
  - Slide #2 contains 11 elements.
  - Slide #3 contains 9 elements.
  - Slide #4 contains 5 elements.
  - Slide #5 contains 12 elements.</code></pre>
  </div>
  </div>
  </p>
  
  <p>So it worked. Then I tried to run test_snippets.py in:</p>
  
  <p>(python-samples-master/slides/snippets)</p>
  
  <p>And I get an error </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>======================================================================
  ERROR: setUpClass (__main__.SnippetsTest)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "~/anaconda3/lib/python3.7/site-packages/oauth2client/client.py", line 1228, in _implicit_credentials_from_files
      credentials_filename)
    File "~/anaconda3/lib/python3.7/site-packages/oauth2client/client.py", line 1397, in _get_application_default_credential_from_file
      AUTHORIZED_USER + "' or '" + SERVICE_ACCOUNT + "' values)")
  oauth2client.client.ApplicationDefaultCredentialsError: 'type' field should be defined (and have one of the 'authorized_user' or 'service_account' values)
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "test_snippets.py", line 32, in setUpClass
      super(SnippetsTest, cls).setUpClass()
    File "~/Desktop/python-samples-master/slides/snippets/base_test.py", line 27, in setUpClass
      cls.credentials = cls.create_credentials()
    File "~/Desktop/python-samples-master/slides/snippets/base_test.py", line 44, in create_credentials
      credentials = GoogleCredentials.get_application_default()
    File "~/anaconda3/lib/python3.7/site-packages/oauth2client/client.py", line 1271, in get_application_default
      return GoogleCredentials._get_implicit_credentials()
    File "~/anaconda3/lib/python3.7/site-packages/oauth2client/client.py", line 1256, in _get_implicit_credentials
      credentials = checker()
    File "~/anaconda3/lib/python3.7/site-packages/oauth2client/client.py", line 1231, in _implicit_credentials_from_files
      extra_help, error)
    File "~/anaconda3/lib/python3.7/site-packages/oauth2client/client.py", line 1429, in _raise_exception_for_reading_json
      credential_file + extra_help + ': ' + str(error))
  oauth2client.client.ApplicationDefaultCredentialsError: An error was encountered while reading json file: ~/Documents/credentials/credentials.json (pointed to by GOOGLE_APPLICATION_CREDENTIALS environment variable): 'type' field should be defined (and have one of the 'authorized_user' or 'service_account' values)</code></pre>
  </div>
  </div>
  </p>
  
  <p>I definitely have a GOOGLE_APPLICATION_CREDENTIALS that points to the same credentials that successfully ran quickstart.py.</p>
  
  <p>Is there something else I need or do I need to change some code to load the credentials data in?</p>
  
  <p>It seems like GoogleCredentials.get_application_default() call is the one that is erroring</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>    def create_credentials(cls):
          credentials = GoogleCredentials.get_application_default()
          scope = [
              'https://www.googleapis.com/auth/drive',
          ]
          return credentials.create_scoped(scope)</code></pre>
  </div>
  </div>
  </p>