简体   繁体   English

为什么即使我安装了pyaudio也找不到?

[英]Why is pyaudio not found even after I installed it?

I have the following piece of code:我有以下代码:

import speech_recognition as siri
listener = siri.Recognizer()
try:
    with siri.Microphone() as sources:
        print("Listening.")
        voice = listener.listen(sources)
        command = listener.recognize_google(voice)
        print(command)
except Exception as e:
    print(e)

But, I am getting a ModuleNotFound Error但是,我收到ModuleNotFound Error

Could not find PyAudio; check installation

But I already installed it:但我已经安装了它:

Requirement already satisfied: PyAudio in 
c:\users\name\appdata\local\programs\python\python36\lib\site-packages (0.2.11)

Go to https://www.lfd.uci.edu/~gohlke/pythonlibs/ Go 到https://www.lfd.uci.edu/~gohlke/pythonlibs/

Search alphabetically till you find Pyaudio.按字母顺序搜索,直到找到 Pyaudio。

Click on the link that matches your python version and os bit.单击与您的 python 版本和操作系统位匹配的链接。

After the download is complete, go to downloads on your pc.下载完成后,go 下载到你的电脑上。

Open cmd there.在那里打开 cmd。

Run the command: pip install "filename"运行命令:pip install "filename"

For example: pip install PyAudio-0.2.11-cp39-cp39-win_amd64.whl例如:pip 安装 PyAudio-0.2.11-cp39-cp39-win_amd64.whl

It should work!它应该工作!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM