问题
We are trying to get the following command to work from this python example for loading a CSV file into BigQuery from Google Cloud Storage:
from google.cloud import bigquery
But after doing pip install google.cloud
we receive the following error when we try to run that command:
ImportError: cannot import name bigquery
If we installed google.cloud
- shouldn't bigquery
be included? What are missing?
We are running Python 2.7.
回答1:
It looks like installing google-cloud may once have behaved as you expect, but no longer does:
WARNING: The google-cloud Python package is deprecated. On June 18, 2018, this package will no longer install any other packages. Please install the product-specific google-cloud-* packages needed for your application.
The documentation now says that the Python BigQuery client library is called google-cloud-bigquery
. Try installing that instead.
来源:https://stackoverflow.com/questions/53017778/why-does-pip-install-google-cloud-not-enable-bigquery