Below is the code
import httplib2, argparse, os, sys, json
from oauth2client import tools, file, client
from oauth2client.service_account import ServiceAccountCredentials
from googleapiclient import discovery
from googleapiclient.errors import HttpError
scope = ['https://www.googleapis.com/auth/prediction','https://www.googleapis.com/auth/devstorage.read_only']
def get_api(api, scope, service_account=True):
storage = file.Storage('oAuth2.json')
creds = storage.get()
if creds is None or creds.invalid:
creds = ServiceAccountCredentials.from_json_keyfile_name('service_account.json',
scopes=scope)
storage.put(creds)
http = creds.authorize(httplib2.Http())
return discovery.build(api, 'v1.6', http=http)
api = get_prediction_api('prediction')
Below is the error
TypeError: cannot instantiate ctype 'EVP_MD_CTX' of unknown size
Based on this blog
Using this google-api-python-client
The google-api-python-client that I installed (link above) only works with python2. As of today, it doesn't work with python2 inside of conda env, only outside of conda env, and doesn't work with python 3.5.