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:\Users\XXX\AppData\Local\Programs\Python\Python35
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
I faced the same issue, I was trying to import translate from google.cloud but kept getting same error.
This is what I did
pip install protobuf
pip install google-cloud-translate
and to install storage service from google google-cloud-storage
should be installed separately
got this from cloud service documentation
pip install --upgrade google-cloud-translate
Worked for me !
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.
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
kindly executed these commands.
pip install google
pip install google-core-api
will definitely solve your problem
Use this both installation and then go ahead with your python code
pip install google-cloud
pip install google-cloud-vision
Note - You need not have to uninstall/reinstall anything.
I could fix it by installing the following directly.
pip install google.cloud.bigquery
pip install google.cloud.storage
I solved the problem in this way:
and no more error.
Source: Stackoverflow.com