Problem scenario
You run a Python program or from the Python command prompt you receive this message:
Traceback (most recent call last):
File “main.py”, line 21, in <module
from google.cloud import pubsub_v1
ImportError: No module named ‘google.cloud’
…
ModuleNotFoundError: No module named ‘google’
What should you do to eliminate this problem?
Possible Solution #1
Try to run the program as sudo:
sudo python nameOfProg.py
Possible Solution #2
Try this with or without sudo (depending on whether or not you are using “sudo” to run the Python program):
sudo pip install google-cloud-bigquery
# You may or may not want to omit the “sudo” in the above command.
…
Continue reading “How Do You Troubleshoot This Message “ImportError: No module named ‘google.cloud’?”