Please build and install the PortAudio Python bindings first

心不动则不痛 提交于 2019-12-13 02:58:32

问题


i already installed pyaudio but the problem is when i work with the microphone functions

import speech_recognition as sr
r = sr.Recognizer()
mic = sr.Microphone()

the problem is in the third line mic = sr.Microphone() the terminal will give me this message

Please build and install the PortAudio Python bindings first.

and if i try to install pip install PortAudio it will give me the following message

Could not find a version that satisfies the requirement PortAudio (from versions: )No matching distribution found for PortAudio

so can any one help , it is like i have the pyaudio but the PortAudio is not there !!


回答1:


Do not type pip install PortAudio
There is no such package

You can rather use

pip install port audio

(lowercase with a space between it).
Happy to Help.




回答2:


first uninstall your pyAudio by pip uninstall pyAudio

then you need to get the pyAudio compatible with your python version in my case i have 3.7 with 32bit , my problem was trying to install a 64bit pyAudio on my 32bit python .

after the uninstalling i went to this website: Unofficial Windows Binaries for Python Extension Packages

and i downloaded the [ PyAudio‑0.2.11‑cp37‑cp37m‑win32.whl ]

the way to install it is to go to its directory in the cmd and type pip install PyAudio‑0.2.11‑cp37‑cp37m‑win32.whl

and i think this will do and over come the PortAudio problem



来源:https://stackoverflow.com/questions/55202342/please-build-and-install-the-portaudio-python-bindings-first

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!