0

I’ve been running into the same error code when trying to use Python 3.7 to query data from BigQuery. I have enabled the API and also followed instructions on which client libraries to download using the terminal on my MacOS.

I’m not sure what the issue is but each time I try to input the code from google.cloud import bigquery, it returns this error:

ModuleNotFoundError: No module named 'google‘

I am very new to these environments, including python and am not familiar with setting up $PATH for running my parameterized query. A sample of what I’m trying to run could be found here: https://github.com/googleapis/python-bigquery/blob/35627d145a41d57768f19d4392ef235928e00f72/samples/client_query_w_named_params.py

Any help on this would be greatly appreciated. Thank you!

  • did you follow the installation instructions from https://github.com/googleapis/python-bigquery/tree/35627d145a41d57768f19d4392ef235928e00f72#installation ? you'll need to have a virtual environment with the google module installed and activated (nothing to do with $PATH) to verify if you're working on the environment you can do ```which python```. (it should point to the environment that you created) to verify if you have google module: ```python -c 'from google.cloud import bigquery' ``` (only verify if the module is there by importing it, no action is done here). – lhd Aug 09 '21 at 15:25

1 Answers1

1

Try install the package again with :

python3 -m pip install --upgrade google-cloud-bigquery you might want to use python instead of python3, depending on your setup

Had the same error as your, this worked on MacOS

p.s: cannot post to comment due to insufficient reputation

See also: ImportError: No module named google.cloud

Alfred Tso
  • 51
  • 4