NameError: name 'build' is not defined

PandaPanda

I'm trying to write a python script to fetch entries from a google calendar.

I am getting a NameError: name 'build' is not defined for the line below:

service = build('calendar','v3',credentials=credentials)

Are there any suggestions for how to fix this?

noogui

You can use the Python Quickstart for Calendar API as reference.

Notice in the import section which module the build method was derived from:

from __future__ import print_function
from apiclient.discovery import build //notice the build here
from httplib2 import Http
from oauth2client import file, client, tools
import datetime

before it was used here:

service = build('calendar', 'v3', http=creds.authorize(Http()))

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related