Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BigQuery: ImportError due to missing client_pb2 #8674

Closed
@shiroyuki

Description

@shiroyuki

Environment details

OS Affected Python Versions Virtual Environment Used?
MacOS 10.14.5 Python 3.7.0 and 3.7.4 No
→ pip3 list | grep google
google-api-core               1.13.0   
google-auth                   1.5.1    
google-cloud-bigquery         1.17.0   
google-cloud-core             1.0.2    
google-cloud-storage          1.13.0   
google-resumable-media        0.3.1    
googleapis-common-protos      1.5.5

Steps to reproduce

  1. Just try to import bigquery. ImportError is raised at this step.

(Updated: at July 15 11:34 AM EDT)
Please note that:

  • Without using a virtual environment, importing the module is perfectly fine on Debian.
  • Importing the module on MacOS with the virtual environment is ok while doing the same thing on MacOS without the virtual environment raises ImportError.

Code example

from google.cloud import bigquery

Stack trace

Traceback (most recent call last):
  File "zero/mp-118.py", line 1, in <module>
    from google.cloud import bigquery
  File "/usr/local/lib/python3.7/site-packages/google/cloud/bigquery/__init__.py", line 35, in <module>
    from google.cloud.bigquery.client import Client
  File "/usr/local/lib/python3.7/site-packages/google/cloud/bigquery/client.py", line 53, in <module>
    from google.cloud.bigquery.dataset import Dataset
  File "/usr/local/lib/python3.7/site-packages/google/cloud/bigquery/dataset.py", line 24, in <module>
    from google.cloud.bigquery.model import ModelReference
  File "/usr/local/lib/python3.7/site-packages/google/cloud/bigquery/model.py", line 27, in <module>
    from google.cloud.bigquery_v2 import types
  File "/usr/local/lib/python3.7/site-packages/google/cloud/bigquery_v2/__init__.py", line 23, in <module>
    from google.cloud.bigquery_v2 import types
  File "/usr/local/lib/python3.7/site-packages/google/cloud/bigquery_v2/types.py", line 23, in <module>
    from google.cloud.bigquery_v2.proto import model_pb2
  File "/usr/local/lib/python3.7/site-packages/google/cloud/bigquery_v2/proto/model_pb2.py", line 28, in <module>
    from google.api import client_pb2 as google_dot_api_dot_client__pb2
ImportError: cannot import name 'client_pb2' from 'google.api' (/usr/local/lib/python3.7/site-packages/google/api/__init__.py)

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the BigQuery API.packagingtype: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions