-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Hello, I'm getting a name exception when running a simple script. I've tried running the script in two ways:
from apiclient import discovery
import json
from pprint import pprint
from httplib2 import Http
from oauth2client.service_account import ServiceAccountCredentials
scopes = ['https://www.googleapis.com/auth/fusiontables']
credentials = ServiceAccountCredentials.from_json_keyfile_name(
'service-account.json', scopes)
ft = discovery.build('fusiontables', 'v2', credentials=credentials)
pprint(ft)
Which gives:
Traceback (most recent call last):
File "apiTest.py", line 1, in
from apiclient import discovery
File "build/bdist.linux-x86_64/egg/apiclient/init.py", line 18, in
File "build/bdist.linux-x86_64/egg/googleapiclient/channel.py", line 64, in
ImportError: cannot import name util
And:
from apiclient.discovery import build
import json
from pprint import pprint
from httplib2 import Http
from oauth2client.service_account import ServiceAccountCredentials
scopes = ['https://www.googleapis.com/auth/fusiontables']
credentials = ServiceAccountCredentials.from_json_keyfile_name(
'service-account.json', scopes)
ft = discovery.build('fusiontables', 'v2', credentials=credentials)
pprint(ft)
#print response
Which yields the same exception:
python apiTest.py
Traceback (most recent call last):
File "apiTest.py", line 1, in
from apiclient.discovery import build
File "build/bdist.linux-x86_64/egg/apiclient/init.py", line 18, in
File "build/bdist.linux-x86_64/egg/googleapiclient/channel.py", line 64, in
ImportError: cannot import name util
I'm not sure if I'm missing a prereq or what, but I'm not able to find a way around this.