在Mint上安装用于Python3的PyAudio时遇到问题 [英] Having trouble installing PyAudio for Python3 on Mint
问题描述
我正在此处进行操作,但遇到了麻烦使安装正常工作.基本上,第一部分工作正常.我下载了portaudio,按照说明进行操作,一切似乎都可以正常工作.
I was following the instructions here and I'm having trouble getting the installation to work. Basically, the first part works fine. I downloaded portaudio, followed the instructions, and it all seemed to work.
但是,当我尝试python3 setup.py install
时,出现错误.该错误来自/src/_portaudiomodule.c文件,它说找不到文件Python.h".我不太了解发生了什么,因为提取PyAudio存档时没有Python.h文件.我不知道Python.h文件应该来自哪里.
However, when I triedpython3 setup.py install
, I got an error. The error came from the /src/_portaudiomodule.c file, and it said that "The file Python.h could not be found". I don't really understand what's going on because there was no Python.h file when I extracted the PyAudio archive. I don't know where the Python.h file was supposed to come from.
我对Unix系统有点菜鸟,所以我很容易在某个地方犯了一个错误.我已经尝试解决了几个小时,到目前为止我还没有碰到运气.预先感谢您的帮助!
I'm kind of a noob to unix systems so I could have easily made a mistake somewhere. I've been trying to solve this for hours and I've had no luck so far. Thanks in advance for your help!
推荐答案
要使用conda安装最新版本的pyaudio:
To install the latest version of pyaudio using conda:
source activate -your environment name-
pip install pyaudio
从pip安装时,您可能会遇到以下错误:
You may run into the following error when installing from pip:
src/_portaudiomodule.c:29:23: fatal error: portaudio.h: No such file or directory
#include "portaudio.h"
compilation terminated.
error: command 'gcc' failed with exit status 1
那是因为您没有安装PortAudio开发包.安装:
That is because you don't have the PortAudio development package installed. Install it with:
sudo apt-get install portaudio19-dev
这篇关于在Mint上安装用于Python3的PyAudio时遇到问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!