Gspread authorization error in pythonanywhere?

  • 0
    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('key.json', scope)
    
    gc = gspread.authorize(credentials)


    The same code, but when I run it on my own - everything works fine, when I run it on pythonanywhere - the error crashes
    argument should be integer or bytes-like object, not 'str'

    How to fix?
    Python Nora Horn, Jan 19, 2019

  • 1 Answers
  • 0
    gc = gspread.authorize (credentials.encode ())
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!