ImportError: no module named google.cloud

I can not import google.cloud.speech

from google.cloud import speech

I installed it using:

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

This results in an error below when importing from dir-name

ImportError: No module named google.cloud

the google package with all the additional package is present there, but without __ init __ .py in each additional package.

How to import these packages without adding __ init __ .py to the package folder?

PS: I also tried from __ future __ import absolute_import, but its not working.

+24
source share
9 answers

" Cloud Speech API" , .

Python Debian :

pip install --upgrade google-cloud-speech

+7

sudo python -m pip install google-cloud, .

+4

:

$ git clone https://github.com/GoogleCloudPlatform/google-cloud-python
$ cd google-cloud-python/speech
$ python setup.py install

.

+2

" google.cloud" Python Google.

pip install virtualenv
virtualenv <your-env>
source <your-env>/bin/activate
<your-env>/bin/pip install <google-cloud>

<google-cloud> . : google-cloud-vision google-cloud-storage ..

+1

: "get_messages", - "google.cloud". Python 3:

from google.api_core.protobuf_helpers import get_messages
from google.cloud import speech
+1

Python3, Python.

0

. , Cloud Speech-to-Text API. , .

0

:

 pip show google-cloud

:

Name: google-cloud
Version: 0.34.0
Summary: API Client library for Google Cloud
Home-page: https://github.com/GoogleCloudPlatform/google-cloud-python
Author: Google Cloud Platform
Author-email: googleapis-publisher@google.com
License: Apache 2.0
Location: c:\users\<user>\appdata\roaming\python\python37\site-packages
Requires:
Required-by:

PATH (env vars)

0

:

pip install google-cloud-bigquery
0

Source: https://habr.com/ru/post/1678655/


All Articles