Reputation: 51
I get an error when importing google.cloud.bigquery
on GCE.
It did not happen in an environment that is not GCE.
I executed update with pip
.
Do you know why?
user1@sv1:~$ python
Python 3.6.0 |Continuum Analytics, Inc.| (default, Dec 23 2016,12:22:00)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from google.cloud import bigquery
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/user1/miniconda3/lib/python3.6/site-packages/google/cloud/bigquery/__init__.py", line 34, in <module>
from google.cloud.bigquery.client import Client
File "/home/user1/miniconda3/lib/python3.6/site-packages/google/cloud/bigquery/client.py", line 32, in <module>
import google.cloud._helpers
11/11/2018 add Thank you for answering. It did not work since creating a new python using pyenv ,I think my server is something wrong. I reset the server and try again.
Upvotes: 2
Views: 2628
Reputation: 14791
In June 2018, Google deprecated the google.cloud
Python package. You need to directly use the BigQuery module directly by using pip install --upgrade google-cloud-bigquery
, not pip install --upgrade google-cloud
.
More info here.
Upvotes: 2
Reputation: 2065
Where are you running this script exactly? Have you tried setting up a virtualenv and running it there? It all seems probably related to te Python version or conflicting packages.
For example, running the same from the Cloud Shell works without problem (no need to install any libraries nor use virtualenv in that one for this):
$ python
Python 2.7.13 (default, Sep 26 2018, 18:42:22)
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from google.cloud import bigquery
>>>
Upvotes: 1