ImportError: No module named 'google'

Solution 1:

According to https://github.com/googleapis/google-api-python-client#installation, you need to install the google-api-python-client package:

pip install --upgrade google-api-python-client

Solution 2:

Use this both installation and then go ahead with your Python code:

pip install google-cloud
pip install google-cloud-vision

Solution 3:

I could fix it by installing the following directly.

pip install google.cloud.bigquery
pip install google.cloud.storage

Solution 4:

I figured out the solution:

  • I had to delete my Anaconda and Python installations
  • Re-install Anaconda only
  • Open the Anaconda prompt and point it to Anaconda/Scripts
  • Run pip install google
  • Run the sample code now from Spyder.

No more errors.

Solution 5:

I faced the same issue, and I was trying to import translate from google.cloud, but I kept getting the same error.

This is what I did

  1. pip install protobuf
  2. pip install google-cloud-translate

And to install the storage service from google google-cloud-storage, it should be installed separately.

Ref - https://cloud.google.com/python/