-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Labels
triage meI really want to be triaged.I really want to be triaged.
Description
Environment details
-
OS type and version: ubuntu 16.04.6 LTS (4.15.0-1050-gcp)
-
Python version: 3.6.8
-
pip version: 3.6
-
google-api-python-clientversion: 1.7.1
from apiclient.discovery import build
SCOPES = ['https://www.googleapis.com/auth/analytics.readonly']
KEY_FILE_LOCATION = conf.KEY_FILE_LOCATION
credentials = ServiceAccountCredentials.from_json_keyfile_name(
KEY_FILE_LOCATION, SCOPES)
# Build the service object.
if version == 'v4':
analytics = build('analyticsreporting', 'v4', credentials=credentials, cache_discovery=False)
elif version == 'v3':
analytics = build('analytics', 'v3', credentials=credentials, cache_discovery=False)
return analyticsPS. KEY_FILE_LOCATION is a json key generated from GCP
Stack trace
File "/home/dsu/ddt_dashboard/ddt_get_ga_report/lib/app.py", line 454, in get_report
analyticsV3 = initialize_analyticsreporting('v3')
File "/home/dsu/ddt_dashboard/ddt_get_ga_report/lib/app.py", line 117, in initialize_analyticsreporting
analytics = build('analytics', 'v3', credentials=credentials, cache_discovery=False)
File "/usr/local/lib/python3.6/dist-packages/googleapiclient/_helpers.py", line 134, in positional_wrapper
return wrapped(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/googleapiclient/discovery.py", line 300, in build
discovery_http.close()
AttributeError: 'Http' object has no attribute 'close'
The code works fine on my local machine (win10).
Not sure if it is about package dependency or something else.
Any suggestions would be appreciated, thanks.
Enf0, sabareesh-chinta, mike-seekwell and BaptisteVerneuil
Metadata
Metadata
Assignees
Labels
triage meI really want to be triaged.I really want to be triaged.
