ImportError: No module named google.cloud

nishith picture nishith · Jun 6, 2017 · Viewed 83.4k times · Source

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.

Answer

George picture George · Oct 5, 2017

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