File "/usr/local/lib/python3.7/dist-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 "speechrecog.py", line 5, in <module>
with sr.Microphone() as source:
File "/usr/local/lib/python3.7/dist-packages/speech_recognition/__init__.py", line 79, in __init__
self.pyaudio_module = self.get_pyaudio()
File "/usr/local/lib/python3.7/dist-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
答案 0 :(得分:0)
尝试安装pyaudio(此处为https://people.csail.mit.edu/hubert/pyaudio/的详细信息)。 祝你好运
答案 1 :(得分:0)
通常在您的程序尝试使用您自己尚未安装的模块时发生。 Python本身内置了一些模块,例如数学。您需要使用pyaudio的方法是将其安装到该项目已经存在的目录中。
在终端窗口中,cd
到项目目录,运行python -m pip install pyaudio
让我知道是否可行。