How to install gcp in Python?

0 votes

There are a lot of BigQuery examples having 

import gcp.bigquery as bigQ

I'm getting an error ImportError: No module named gcp.bigquery while running this.

Is there any way to install this library?  I couldn't get any help from the documentation.

May 10, 2018 in GCP by Data_Nerd
• 2,360 points
147 views

2 answers to this question.

0 votes

This might work

$ pip install --upgrade google-api-python-client
answered May 10, 2018 by shams
• 3,580 points
0 votes

If you're accessing BigQuery in python, you can do that using the gcloud library.

First, install the gcloud library:

$ pip install --upgrade gcloud

Then, after setting up your auth and project info, you can make api calls in python like this (adapted from the gcloud-python docs):

from gcloud import bigquery

client = bigquery.Client()
datasets, next_page_token = client.list_datasets()
print([dataset.name for dataset in datasets])

(As someone mentioned previously, you can also do it using the google-api-python-client.)

License: Apache 2

answered Aug 20, 2018 by Priyaj
• 56,520 points

Related Questions In GCP

+2 votes
2 answers

How to download multiple files in Google Cloud Storage?

You can achieve this through the gsutil ...READ MORE

answered May 9, 2018 in GCP by kurt_cobain
• 9,240 points
3,996 views
0 votes
2 answers

How to transfer google cloud project ownership?

Go to IAM and Admin Then Select IAM Click Add Provide another user's ...READ MORE

answered Aug 20, 2018 in GCP by Priyaj
• 56,520 points
648 views
+1 vote
2 answers

How to open a port on google compute engine

You need to set the firewall rule ...READ MORE

answered Jul 9 in GCP by K sagar
92 views
0 votes
1 answer

Changing Machine Instance on GCP

There is no direct method to change ...READ MORE

answered Aug 1, 2018 in GCP by kurt_cobain
• 9,240 points
37 views
0 votes
0 answers

Cron runs twice in cluster environment

I've a cluster in GCP. which has ...READ MORE

3 days ago in GCP by anonymous
7 views
0 votes
2 answers
0 votes
1 answer

How to delete a project from Google Cloud Console

First of all, select the project you ...READ MORE

answered Apr 18, 2018 in GCP by kurt_cobain
• 9,240 points
142 views
+3 votes
11 answers

How do I delete my Google Cloud Platform Account?

How do I delete me cloud and ...READ MORE

answered Jan 18 in GCP by dodge123@yahoo.com
12,847 views
0 votes
2 answers

Google Cloud datastore vs firebase

Google has already made a guide for ...READ MORE

answered Aug 20, 2018 in GCP by Priyaj
• 56,520 points
196 views