gpt4 book ai didi

python-2.7 - 无法使用语音识别解决缺少的 google-api-python-client 模块

转载 作者:行者123 更新时间:2023-12-04 18:48:59 28 4
gpt4 key购买 nike

我正在尝试运行 speech recognition在装有 Armbian 的 tinkerboard 上。我总是收到这个错误

ERROR - Error fetching results from Speech Recognition service missing google-api-python-client module: ensure that google-api-python-client is set up correctly.

即使我使用 pip list 检查 pip 中已安装的软件包,我也可以看到 google-api-python-client 已安装。

点子列表输出
cachetools (2.1.0)
certifi (2018.10.15)
chardet (3.0.4)
google-api-python-client (1.7.4)
google-auth (1.5.1)
google-auth-httplib2 (0.0.3)
httplib2 (0.11.3)
idna (2.7)
Mirage (0.9.5.2)
pip (9.0.1)
pyasn1 (0.4.4)
pyasn1-modules (0.2.2)
PyAudio (0.2.11)
pycairo (1.16.2)
requests (2.20.0)
rsa (4.0)
setuptools (40.4.3)
six (1.11.0)
SpeechRecognition (3.8.1)
uritemplate (3.0.0)
urllib3 (1.24)
wheel (0.32.2)

控制台上的输出是
tinkerboard@tinkerboard:~/Documents/smarthome_studyplatform/py_workspace/voice_assistant1.0/speech_recognition$ python assistant2.0.py -u rahul -a GoogleCloudSpeech -l english
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
10/25/2018 10:02:07 PM - __main__ - INFO - Language : english
10/25/2018 10:02:07 PM - __main__ - INFO - API : GoogleCloudSpeech
10/25/2018 10:02:07 PM - __main__ - INFO - User : rahul
10/25/2018 10:02:07 PM - __main__ - INFO - Initiating speech recognition.
10/25/2018 10:02:08 PM - __main__ - INFO - Setting minimum energy threshold to [117.178533524]
10/25/2018 10:02:08 PM - __main__ - INFO - Waiting for user query
10/25/2018 10:02:11 PM - __main__ - INFO - Audio captured, begin speech to text.
10/25/2018 10:02:12 PM - __main__ - ERROR - Error fetching results from Speech Recognition service missing google-api-python-client module: ensure that google-api-python-client is set up correctly.

请有人建议我为什么会收到此错误以及如何解决?

谢谢

最佳答案

我也遇到了这个错误,尝试使用 SpeechRecognition 库并得到“缺少 google-api-python-client 模块:确保 google-api-python-client 设置正确。”

回复以增加对 F10's comment on the question 的可见性并跟进他们的建议 做了解决它:确保安装了 oauth2client。

采用
pip install oauth2client
或者
pip3 install oauth2client .

在某些环境中,您可能需要 sudo pip install oauth2clientsudo pip3 install oauth2client

关于python-2.7 - 无法使用语音识别解决缺少的 google-api-python-client 模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52998871/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com