系统找不到指定的文件 - Python 语音识别

The system cannot find the file specified - Python Speech Recognition

enter image description here

import speech_recognition as sr

listener = sr.Recognizer()

try:
    with sr.Microphone() as source:
        print("listening...")
        voice = listener.listen(source)
        info = listener.recognize_google(voice)
        print(info)

except Exception as e:
    print(e)

显示: [WinError 2] The system cannot find the file specified

预期的输出应该是打印我所说的所有内容。

我已经使用 pipwin 安装了 PyAudio。

嗨,使用 pipwin 安装 pyaudio

pipwin install pyaudio

我也遇到了同样的问题,我的做法是:

首先使用pip安装pipwin:

pip install pipwin

然后使用pipwin安装pyaudio:

pipwin install pyaudio

此问题已通过重置 python 解释器的路径变量得到解决。感谢所有的回答和你的努力