title: authentication - connect to datalab from compute engine
body: <p>I would like to connect to bigQuery from datalab and execute update commands.
  I run the following code for the API &amp; authentication:</p>
  
  <pre><code>from google.cloud import bigquery
  
  # Get everything we possibly can from the service account JSON file
  #set GOOGLE_APPLICATION_CREDENTIALS
  cred = bigquery.Client.from_service_account_json('OrielResearch-da46e752c7ff.json')
  # Instantiates a client
  client = bigquery.Client(project='speedy-emissary-167213',credentials=cred)
  # The name of the dataset
  dataset_name = 'pgp_orielresearch'
  # The name of the table
  table_name = 'update_queries'
  # Perform a synchronous query.
  QUERY = (
      'SELECT * FROM [speedy-emissary-167213:pgp_orielresearch.update_queries]')
  query = client.run_sync_query(QUERY)
  dataset = client.dataset(dataset_name)
  tables, token = dataset.list_tables()
  </code></pre>
  
  <p>and get the following error: 
  AttributeError: 'Client' object has no attribute 'authorize'</p>
  
  <p>any idea?</p>
  
  <p>the full stack is:</p>
  
  <pre><code>AttributeErrorTraceback (most recent call last)
  &lt;ipython-input-2-616f54fa35ba&gt; in &lt;module&gt;()
       19 query = client.run_sync_query(QUERY)
       20 dataset = client.dataset(dataset_name)
  ---&gt; 21 t = dataset.list_tables()
       22 #query.timeout_ms = TIMEOUT_MS
       23 #query.run()
  
  /usr/local/lib/python2.7/dist-packages/google/cloud/bigquery/dataset.py in list_tables(self, max_results, page_token)
      568         connection = self._client.connection
      569         resp = connection.api_request(method='GET', path=path,
  --&gt; 570                                       query_params=params)
      571         tables = [Table.from_api_repr(resource, self)
      572                   for resource in resp.get('tables', ())]
  
  /usr/local/lib/python2.7/dist-packages/google/cloud/connection.pyc in api_request(self, method, path, query_params, data, content_type, api_base_url, api_version, expect_json, _target_object)
      344         response, content = self._make_request(
      345             method=method, url=url, data=data, content_type=content_type,
  --&gt; 346             target_object=_target_object)
      347 
      348         if not 200 &lt;= response.status &lt; 300:
  
  /usr/local/lib/python2.7/dist-packages/google/cloud/connection.pyc in _make_request(self, method, url, data, content_type, headers, target_object)
      242         headers['User-Agent'] = self.USER_AGENT
      243 
  --&gt; 244         return self._do_request(method, url, headers, data, target_object)
      245 
      246     def _do_request(self, method, url, headers, data,
  
  /usr/local/lib/python2.7/dist-packages/google/cloud/connection.pyc in _do_request(self, method, url, headers, data, target_object)
      270         :returns: The HTTP response object and the content of the response.
      271         """
  --&gt; 272         return self.http.request(uri=url, method=method, headers=headers,
      273                                  body=data)
      274 
  
  /usr/local/lib/python2.7/dist-packages/google/cloud/connection.pyc in http(self)
      101             self._http = httplib2.Http()
      102             if self._credentials:
  --&gt; 103                 self._http = self._credentials.authorize(self._http)
      104         return self._http
      105 
  
  AttributeError: 'Client' object has no attribute 'authorize'
  </code></pre>