1
import io
import os 
os.environ["GOOGLE_APPLICATION_CREDENTIALS"]="ip-boundary-996e9662df4c.json"

from google.cloud import speech

I am trying to load the library required to use Google STT, but an error occurs. Here's what the error says:

Traceback (most recent call last):
  File "/home/yugwon/IP_boundary/server/stt.py", line 5, in <module>
    from google.cloud import speech
  File "/home/yugwon/IP_boundary/venv/lib/python3.7/site-packages/google/cloud/speech/__init__.py", line 17, in <module>
    from google.cloud.speech_v1 import SpeechClient
  File "/home/yugwon/IP_boundary/venv/lib/python3.7/site-packages/google/cloud/speech_v1/__init__.py", line 17, in <module>
    from .services.speech import SpeechClient
  File "/home/yugwon/IP_boundary/venv/lib/python3.7/site-packages/google/cloud/speech_v1/services/speech/__init__.py", line 16, in <module>
    from .client import SpeechClient
  File "/home/yugwon/IP_boundary/venv/lib/python3.7/site-packages/google/cloud/speech_v1/services/speech/client.py", line 43, in <module>
    from google.api_core import operation  # type: ignore
  File "/home/yugwon/IP_boundary/venv/lib/python3.7/site-packages/google/api_core/operation.py", line 45, in <module>
    from google.longrunning import operations_pb2
  File "/home/yugwon/IP_boundary/venv/lib/python3.7/site-packages/google/longrunning/operations_pb2.py", line 26, in <module>
    from google.longrunning.operations_proto_pb2 import *
  File "/home/yugwon/IP_boundary/venv/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py", line 31, in <module>
    from google.api import client_pb2 as google_dot_api_dot_client__pb2
ImportError: cannot import name 'client_pb2' from 'google.api' (/home/yugwon/IP_boundary/python-generated/google/api/__init__.py)

As a workaround for this, I tried the following, but still the same problem appeared and failed.

pip install --upgrade googleapis-common-protos

Below is my venv pip list.

enter image description here

Do you have any other solution?

Nimantha
  • 6,405
  • 6
  • 28
  • 69
yugwon
  • 11
  • 3

0 Answers0