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,390 points

2 answers to this question.

0 votes

This might work

$ pip install --upgrade google-api-python-client
answered May 10, 2018 by shams
• 3,660 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([ 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
• 58,120 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, 2019 in GCP by Sirajul
• 59,070 points
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, 2019 in GCP by Sirajul
• 59,070 points
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, 2019 in GCP by Sirajul
• 59,070 points
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, 2019 in GCP by Sirajul
• 59,070 points
0 votes
1 answer
+2 votes
1 answer

How to create a firewall rule in GCP Cloud?

Hi@akhtar, If you are using the default VPC ...READ MORE

answered Aug 22, 2020 in GCP by MD
• 95,220 points
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,390 points
+7 votes
12 answers

How do I delete my Google Cloud Platform Account?

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

answered Jan 18, 2019 in GCP by
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
• 58,120 points