title: python + google sheets == gspread, but sadly AttributeError: type object 'ServiceAccountCredentials' has no attribute 'from_json_keyfile'
body: <p>I'm trying to connect google sheets with python using gspread library. </p>
  
  <p>I have tried a ginormous set of using examples of gspread, for no avail. I have also used google official libraries with the same tsunami of disappointment and despair (actually google code leads to a authentication page under terminal that doesn't work "because javascript is not enabled in your, well, browser")</p>
  
  <p>my example code:</p>
  
  <pre><code>import gspread
  from oauth2client.service_account import ServiceAccountCredentials
  
  scope = ['https://spreadsheets.google.com/feeds','https://www.googleapis.com/auth/drive']
  
  credentials = ServiceAccountCredentials.from_json_keyfile.name('client_secret.json', scope)
  gc = gspread.authorize(credentials)
  hoja = gc.open('testpy').sheet1
  print(hoja.get_all_records())
  </code></pre>
  
  <p><code>client.secret.json</code> is renamed from secrey key json file obtained from service account credentials. it is something like this</p>
  
  <pre><code>{
  "type": "service_account",
  "project_id": "personaltestpygshee6",
  "private_key_id": "29etcetc",
  "private_key": "-----BEGIN PRIVATE KEY-----\netcetc\n-----END PRIVATE KEY-----\n",
  "client_email": "project@project.iam.gserviceaccount.com",
  "client_id": 423etcetc",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://oauth2.googleapis.com/token",
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/project%40project.iam.gserviceaccount.com"
  }
  </code></pre>
  
  <p>when I run the script, this is the error message that I obtain</p>
  
  <pre><code>File "5testgooshee.py", line 6, in &lt;module&gt;
  credentials = ServiceAccountCredentials.from_json_keyfile.name('client_secret.json', scope)
  AttributeError: type object 'ServiceAccountCredentials' has no attribute 'from_json_keyfile'
  </code></pre>
  
  <p>I have done my homework, I swear. Steam comes out of my ears. I cannot figure out what is the problem and why it works in a lot of examples except mine</p>
  
  <p>Where is the failure? Why I cannot make it work?</p>
  
  <p>Thanks in advance</p>