Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: No module named google.cloud

I am unable to import google.cloud.speech

from google.cloud import speech 

I have installed it using :

pip install --upgrade google-cloud-speech -t dir-name 

It is giving me below error while importing it from dir-name

ImportError: No module named google.cloud 

google package with all the sub package is present over there but without __init__.py in every sub packages as well.

How can I import this packages without adding __init__.py in package folder?

PS : I have also tried from __future__ import absolute_import, but its not working.

like image 947
nishith Avatar asked Jun 06 '17 18:06

nishith


People also ask

How do I fix ModuleNotFoundError No module named Google?

To solve the Python "ModuleNotFoundError: No module named 'google. cloud'" error, install the specific google cloud module that you are importing, e.g. pip install google-cloud-speech if importing speech or pip install google-cloud-storage if importing storage .


2 Answers

The instructions on the "Cloud Speech API Client Libraries" documentation page are now valid and the install is successful, as desired.

I installed the library for Python on my Debian machine using the command:

pip install --upgrade google-cloud-speech

like image 183
George Avatar answered Sep 18 '22 17:09

George


use this:

pip install google-cloud-bigquery 
like image 41
Gunjan Paul Avatar answered Sep 20 '22 17:09

Gunjan Paul