![pyaudio 安装错误:“linux/limits.h:没有这样的文件或目录”](https://linux22.com/image/1158558/pyaudio%20%E5%AE%89%E8%A3%85%E9%94%99%E8%AF%AF%EF%BC%9A%E2%80%9Clinux%2Flimits.h%EF%BC%9A%E6%B2%A1%E6%9C%89%E8%BF%99%E6%A0%B7%E7%9A%84%E6%96%87%E4%BB%B6%E6%88%96%E7%9B%AE%E5%BD%95%E2%80%9D.png)
Running setup.py install for pyaudio ... error
Complete output from command /usr/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-vn4pktw5/pyaudio/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-yky9xwed/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.5
copying src/pyaudio.py -> build/lib.linux-x86_64-3.5
running build_ext
building '_portaudio' extension
creating build/temp.linux-x86_64-3.5
creating build/temp.linux-x86_64-3.5/src
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-6tVwKN/python3.5-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c src/_portaudiomodule.c -o build/temp.linux-x86_64-3.5/src/_portaudiomodule.o
In file included from /usr/include/x86_64-linux-gnu/bits/posix1_lim.h:160:0,
from /usr/include/limits.h:143,
from /usr/lib/gcc/x86_64-linux-gnu/6/include-fixed/limits.h:168,
from /usr/lib/gcc/x86_64-linux-gnu/6/include-fixed/syslimits.h:7,
from /usr/lib/gcc/x86_64-linux-gnu/6/include-fixed/limits.h:34,
from /usr/include/python3.5m/Python.h:11,
from src/_portaudiomodule.c:28:
/usr/include/x86_64-linux-gnu/bits/local_lim.h:38:26: fatal error: linux/limits.h: No such file or directory
#include <linux/limits.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
我已经有了/usr/include/limits.h
。
我怎样才能解决这个问题?
答案1
运行命令sudo apt-get install portaudio19-dev
然后使用:
pip install pyaudio