How to use read_gbq or another bq in IPython to access datasets hosted in BigQuery

I am using iPython notebook to read public google BigQuery dataset for natality I did setup for google-api easy_install --upgrade google-api-python-client


However, it still doesn't detect the installed API

Everyone has an iPython notebook to share when accessing a public dataset and uploading it to the framework in iPython.

import pandas as pd
projectid = "xxxx"
data_frame = pd.read_gbq('SELECT * FROM xxxx', project_id = projectid)

    303     if not _GOOGLE_API_CLIENT_INSTALLED:
--> 304         raise ImportError('Could not import Google API Client.')
    306     if not _GOOGLE_FLAGS_INSTALLED:

ImportError: Could not import Google API Client


I have shared the iPython Notebook entry used at

Additional info: I am running on a server with a docker instance used for iPython server. I ran curl | bash on Linux server

I tried to run some of the generic notebooks or However, I also get ImportError: No module named bq

I suspect this is a simple case of missing dependencies. Anyone with a hint is welcome


source to share

2 answers

As I just said here: / ... I solved the problem with this:

pip install --force-reinstall




Make sure your Pandas is 0.17 or higher:

pip install -U pandas

You can check:

import pandas as pd




All Articles