我正在尝试使用谷歌云平台来录制音频到文本。我一开始就被困住了。
当我试图导入:
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中导入这个文件时,上述错误会在导入后立即弹出:从google.cloud导入语音。但奇怪的是,当我第二次进口时,导入就没问题了。
你知道为什么这不管用吗?
非常感谢!
发布于 2022-05-16 19:14:28
我只是设法使音频到文本的语音API为我工作。你应该试一试:
from google.cloud import speech_v1 as speech
也许只是版本问题。
https://stackoverflow.com/questions/70185176
复制相似问题