AttributeError: Could not find PyAudio; check installation (Speech-recognition)

Viewed 1967

I am using Spyder-IDE and i am trying to make a speach to text classifier with speech_recognition but the problem is every time i run my code i get this error:

Traceback (most recent call last):

  File "C:\ProgramData\Anaconda3\lib\site-packages\speech_recognition\__init__.py", line 108, in get_pyaudio
    import pyaudio

ModuleNotFoundError: No module named 'pyaudio'


During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "C:\Users\User\Downloads\Stuff\untitled0.py", line 6, in <module>
    with sr.Microphone() as source:

  File "C:\ProgramData\Anaconda3\lib\site-packages\speech_recognition\__init__.py", line 79, in __init__
    self.pyaudio_module = self.get_pyaudio()

  File "C:\ProgramData\Anaconda3\lib\site-packages\speech_recognition\__init__.py", line 110, in get_pyaudio
    raise AttributeError("Could not find PyAudio; check installation")

AttributeError: Could not find PyAudio; check installation

yay aren't thoose the words of joy? AttributeError: Could not find PyAudio; check installation is there a way to fix this error?

i also have tried these methods to download PyAudio

pip install PyAudio

conda install PyAudio

but nothing seems to work.

this is my speech to text code:

import speech_recognition as sr

r = sr.Recognizer


with sr.Microphone() as source:
    audio = sr.listen(source)
    
    print(audio)
1 Answers
Related