4

I am trying to run speech recognition on tinkerboard with Armbian installed. I am always geting this error

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

Even when I check installed packages in pip by using pip list, I can see that google-api-python-client is installed.

pip list output

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)

Output on console is

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.

Please can some one suggest why I get this error and how can I resolve it?

Thanks

Loui
  • 533
  • 17
  • 33
  • Do you have enabled the [Speech API](https://console.cloud.google.com/apis/api/speech.googleapis.com/overview) within your Google Cloud Platform project? – F10 Oct 26 '18 at 13:37
  • yes, I have enabled it. – Loui Oct 26 '18 at 16:04
  • I've tried to replicate this, however, after reviewing the [init](https://github.com/Uberi/speech_recognition/blob/f89256b9413e4aa22dee0e5241bfcb7dcd3a9161/speech_recognition/__init__.py#L937) file, which is being called to make the authentication, I'm able to see it uses oauth2client library and this is not being shown on your pip list output. Can you please try installing oauth2client and make your request again? – F10 Nov 01 '18 at 21:00
  • @F10 Sure, I will try this out. Thanks for your efforts. – Loui Nov 02 '18 at 13:47

1 Answers1

14

I had this error as well, trying to use the SpeechRecognition library and got 'missing google-api-python-client module: ensure that google-api-python-client is set up correctly.'

Replying to add visibility to F10's comment on the question and follow up that their advice did resolve it: ensure that oauth2client is installed.

Use

pip install oauth2client

or

pip3 install oauth2client.

In some environments, you may need sudo pip install oauth2client or sudo pip3 install oauth2client

konahart
  • 141
  • 1
  • 4