title: Spotify API authorization + token key error - python3
body: <p>I'm running into this issue where with my script and I'm a bit stumped. I've been running this script with no problems for the past few weeks and now I'm getting a KeyError for the token. </p>
  
  <p>Here's my code:</p>
  
  <pre><code># IMPORTS
  import os
  import re
  import requests
  import json
  import numpy as np
  import pandas as pd
  import time
  from pprint import pprint as pp
  import datetime as dt
  import sys 
  import spotipy
  from spotipy.oauth2 import SpotifyClientCredentials
  acc_path = "../../access/"
  sys.path.append(acc_path)
  
  pd.set_option('display.max_rows', 10000)
  pd.set_option('display.max_columns', 100)
  pd.set_option('display.max_colwidth', -1)
  
  # Spotify Credentials
  sp_url = 'https://api.spotify.com/v1/'
  client_id = os.environ.get('SPOT_CLIENT_ID')
  client_secret = os.environ.get('SPOT_CLIENT_SECRET')
  output_data = '/users/Desktop/file_date.csv'
  spot_scopes = os.environ.get('SPOT_SCOPES')
  spot_user_name = os.environ.get('SPOT_USER_NAME') # spotify account username
  
  sp_acc = requests.post('https://accounts.spotify.com/api/token', data = {'grant_type' : 'client_credentials'}, 
                         auth = (client_id, client_secret))
  sp_bear_head = {'Authorization' : 'Bearer' + str(sp_acc.json()['access_token'])}
  </code></pre>
  
  <h1>KeyERROR</h1>
  
  <pre><code>---&gt; 31 sp_bear_head = {'Authorization' : 'Bearer' + str(sp_acc.json()['access_token'])}
  
  KeyError: 'access_token'
  </code></pre>
  
  <p>I checked my bash to make sure client id, secret scopes etc. are all correct and can confirm that is not the issue. Any direction here would be very helpful!</p>