Question

[Solved] ImportError: No module named ‘google’

This is not a duplicate. My scenario is a bit different and I could not find a solution from similar posts here.
I installed Python 3.5.
I ran the pip install google command and verified the modules. Google was present.
I installed Anaconda 3.5 and tried to run z sample code. But I’m getting the import error. Please find the screen shot attached.
What am I missing? Do I have to link my Spyder to Python installation directory in some way? Why is Spyder unable to google module?

My Python installation directory: C:UsersXXXAppDataLocalProgramsPythonPython35
enter image description here

enter image description here

Solution #1:

According to https://developers.google.com/api-client-library/python/apis/oauth2/v1 you need to install google-api-python-client package:

pip install --upgrade google-api-python-client
Respondent: Saber

Solution #2:

Use this both installation and then go ahead with your python code

pip install google-cloud    
pip install google-cloud-vision
Respondent: Darshit Shah

Solution #3:

I could fix it by installing the following directly.

pip install google.cloud.bigquery
pip install google.cloud.storage
Respondent: Ratnesh Sharma

Solution #4:

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

This is what I did

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

and to install storage service from google google-cloud-storageshould be installed separately

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

Respondent: Arkil Shaikh

Solution #5:

I figured out the solution:

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

No more errors.

Respondent: redwolf_cr7

Solution #6:

I solved the problem in this way:

  1. sudo pip install conda
  2. pip install google

and no more error.

Respondent: Chenxi Rao

Solution #7:

got this from cloud service documentation

pip install –upgrade google-cloud-translate

Worked for me !

Respondent: Amol Buch

Solution #8:

I found a similar error when i tried to access the bigquery from google.cloud.

from google.cloud import bigquery

Error was resolved after i install the google.cloud from conda-forge community.

conda install -c conda-forge google-cloud-bigquery
Respondent: smsivaprakaash

Solution #9:

I had a similar import problem. I noticed that there was no __init__.py file in the root of the google package. So, I created an empty __init__.py and now the import works.

Respondent: Ferenc Pal

Solution #10:

kindly executed these commands.

pip install google
pip install google-core-api

will definitely solve your problem

Respondent: sajjad3277

Solution #11:

  1. Close Anaconda/Spyder
  2. Open command prompt and run the below command
  3. conda update –all
  4. Start the app again and this time it should work.

Note – You need not have to uninstall/reinstall anything.

Respondent: Mohan. A

The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .

Most Popular

To Top
India and Pakistan’s steroid-soaked rhetoric over Kashmir will come back to haunt them both clenbuterol australia bossier man pleads guilty for leadership role in anabolic steriod distribution conspiracy