本文介绍了Windows上的Python PyAudio安装在导入PortAudio V19时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为应用程序安装PyAudio,以记录来自麦克风输入的音频剪辑.我从可执行文件(Windows 7,python 2.6)安装了PyAudio.但是,当我尝试在代码中导入该库时,出现以下错误.

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.

我尝试了 Python PyAudio安装中提供的解决方案问题(使用PortAudio),但是当我使用 http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio

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.

我尝试构建 PortAudio v19 ,但它对我也不起作用.我目前仍处于困境,在这方面的任何帮助,我将不胜感激.

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.

推荐答案

为此,您需要先安装brew.检查链接.然后,输入您的命令

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

brew install portaudio

一旦安装了portaudio,运行

Once portaudio is installed, run

pip install python-pyaudio

这篇关于Windows上的Python PyAudio安装在导入PortAudio V19时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-24 16:45