【发布时间】:2022-05-17 03:14:28
【问题描述】:
我正在尝试使用 Google 云平台将音频转录为文本。我真的一开始就卡住了。
当我尝试导入时:
import os
from google.cloud import speech
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = 'speech-333807-fbe7e537e3a2.json'
speech_client = speech.SpeechClient()
错误弹出:
AttributeError: module 'google.cloud.speech' has no attribute 'SpeechClient'
当我尝试在 python shell 中导入它时,导入后立即弹出上述错误:from google.cloud import speech。但奇怪的是,当我第二次导入时,导入正常。
你知道为什么这不起作用吗?
非常感谢!
【问题讨论】:
标签: python google-cloud-platform text-to-speech