title: Service Account and PyDrive
body: <p>I would like to use the Google Drive API to store some backups on it using a cronjob. I just don't understand how I can use PyDrive using a Service Account. When I generate the service account file, and I put it in the directory as my script as <code>client_secret.json</code>.</p>
  
  <p>Using this code :</p>
  
  <pre class="lang-py prettyprint-override"><code>#!/usr/bin/env python
  # -*- coding: utf8 -*-
  
  
  from pydrive.auth import GoogleAuth
  from pydrive.drive import GoogleDrive
  
  def main():
  
      gauth = GoogleAuth()
      drive = GoogleDrive(gauth)
  
      f = drive.CreateFile({'parent': 'toto'})
      f.SetContentFile('test.drive.py')
      f.Upload()
  
  if __name__ == '__main__':
      main(sys.argv[1:])
  </code></pre>
  
  <p>Result  </p>
  
  <pre><code>pydrive.settings.InvalidConfigError: Invalid client secrets file Invalid file format.
  </code></pre>
  
  <p>Well ok. Then I look at other posts on SO, and find these two :<br>
  <a href="https://stackoverflow.com/questions/22555433/pydrive-and-google-drive-automate-verification-process">Automate Verification Process</a><br>
  The code from the first answer on this question returns this :  </p>
  
  <pre><code>Traceback (most recent call last):
    File "test.drive.py", line 4, in &lt;module&gt;
      from oauth2client.client import SignedJwtAssertionCredentials
  ImportError: cannot import name SignedJwtAssertionCredentials
  </code></pre>
  
  <p>And then this one :<br>
  <a href="https://stackoverflow.com/questions/24419188/automating-pydrive-verification-process">Automating pydrive verification process</a><br>
  Which just... Doesn't help me much.     </p>
  
  <p>Where should I start ? What should I do ? Could someone give me an example with pydrive and Service Authentication just to upload a file ?</p>
  
  <p>EDIT :<br>
  After some more research it seems like I needed to install <code>pycrypto</code> to fix the import error described above. I don't know why as it is not specified in the error message.</p>