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
226 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,920 points

Related Questions In GCP

0 votes
1 answer

How to allow outbound traffic on a custom port in gcp?

To allow outbound traffic through a custom ...READ MORE

answered Sep 26 in GCP by Sirajul
• 37,480 points
30 views
0 votes
1 answer

What are the service accounts in GCP? How to create one?

The special accounts associated with a project are called the Service Accounts. The ...READ MORE

answered Oct 9 in GCP by Sirajul
• 37,480 points
21 views
0 votes
1 answer

How to import a non bootable virtual disk in GCP?

You can use the gcloud compute images import command ...READ MORE

answered Oct 21 in GCP by Sirajul
• 37,480 points
22 views
0 votes
1 answer

How to create a cloud storage bucket in GCP?

Buckets are the basic containers that hold your ...READ MORE

answered Oct 23 in GCP by Sirajul
• 37,480 points
16 views
0 votes
1 answer
+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,260 points
4,903 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,260 points
171 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
16,314 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,920 points
244 views