Python PyAudio installation on windows problems in importing PortAudio V19

▼魔方 西西 提交于 2019-12-11 13:40:04

问题


I'm trying to install PyAudio for an application to record audio clips from microphone input. I installed PyAudio from executable file (Windows 7, python 2.6). However when I try to import this library in my code, I get the following error.

Please build and install the PortAudio Python bindings first.

I tried the solution provided at Python PyAudio installation problems (with PortAudio) but I got the following error message when I installed it using the executable given at http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio

Traceback (most recent call last):
  in <module>
    import pyaudio
  File "C:\Python26\lib\site-packages\pyaudio.py", line 99, in <module>
    import _portaudio as pa
ImportError: DLL load failed: %1 is not a valid Win32 application.

I tried building the PortAudio v19 but It also did not work for me. I'm stuck at this point and I'll appreciate any help in this regard.


回答1:


For this you need to first install brew. Check this link. Then, write in your command

brew install portaudio

Once portaudio is installed, run

pip install python-pyaudio


来源:https://stackoverflow.com/questions/12559778/python-pyaudio-installation-on-windows-problems-in-importing-portaudio-v19

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