gpt4 book ai didi

python - 无法安装和构建 PyAudio

转载 作者:太空宇宙 更新时间:2023-11-04 01:41:43 26 4
gpt4 key购买 nike

我已经使用这个压缩包构建并安装了 PortAudio:'pa_stable_v19_20071207.tar.gz'

完成此步骤后,当我尝试通过此 URL 中的压缩包安装 PyAudio 时:
http://people.csail.mit.edu/hubert/pyaudio/packages/pyaudio-0.2.4.tar.gz

我收到以下错误。在这种情况下可能出了什么问题?

enter code here

root@carmack:~/Desktop/PyAudio-0.2.4# python setup.py install

running install
running build
running build_py
running build_ext
building '_portaudio' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c src/_portaudiomodule.c -o build/temp.linux-i686-2.6 /src/_portaudiomodule.o -fno-strict-aliasing
src/_portaudiomodule.c:30:20: error: Python.h: No such file or directory
In file included from src/_portaudiomodule.c:32:
src/_portaudiomodule.h:33: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.h:36: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.h:40: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.h:43: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.h:47: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.h:50: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.h:53: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.h:56: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.h:59: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.h:63: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.h:66: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.h:69: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.h:72: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.h:77: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.h:80: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.h:83: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.h:86: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.h:92: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.h:95: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.h:98: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.h:101: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.h:104: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.h:107: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.h:110: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.h:115: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.h:118: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.h:121: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.h:124: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:71: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘paMethods’
src/_portaudiomodule.c:165: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
src/_portaudiomodule.c:172: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:186: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:200: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:214: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:228: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:242: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:256: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:271: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:285: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:299: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:317: error: expected declaration specifiers or ‘...’ before ‘PyObject’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_antiset’:
src/_portaudiomodule.c:321: warning: implicit declaration of function ‘PyErr_SetString’
src/_portaudiomodule.c:321: error: ‘PyExc_AttributeError’ undeclared (first use in this function)
src/_portaudiomodule.c:321: error: (Each undeclared identifier is reported only once
src/_portaudiomodule.c:321: error: for each function it appears in.)
src/_portaudiomodule.c: At top level:
src/_portaudiomodule.c:326: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_pyAudio_paDeviceInfo_getseters’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_dealloc’:
src/_portaudiomodule.c:394: error: ‘_pyAudio_paDeviceInfo’ has no member named ‘devInfo’
src/_portaudiomodule.c:397: error: ‘_pyAudio_paDeviceInfo’ has no member named ‘ob_type’
src/_portaudiomodule.c:397: error: ‘PyObject’ undeclared (first use in this function)
src/_portaudiomodule.c:397: error: expected expression before ‘)’ token
src/_portaudiomodule.c: At top level:
src/_portaudiomodule.c:400: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_pyAudio_paDeviceInfoType’
src/_portaudiomodule.c: In function ‘_create_paDeviceInfo_object’:
src/_portaudiomodule.c:448: warning: implicit declaration of function ‘PyObject_New’
src/_portaudiomodule.c:448: error: expected expression before ‘_pyAudio_paDeviceInfo’
src/_portaudiomodule.c: At top level:
src/_portaudiomodule.c:464: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
src/_portaudiomodule.c:470: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:484: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:498: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:512: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:526: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:540: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:556: error: expected declaration specifiers or ‘...’ before ‘PyObject’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_antiset’:
src/_portaudiomodule.c:560: error: ‘PyExc_AttributeError’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_dealloc’:
src/_portaudiomodule.c:569: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:572: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘ob_type’
src/_portaudiomodule.c:572: error: ‘PyObject’ undeclared (first use in this function)
src/_portaudiomodule.c:572: error: expected expression before ‘)’ token
src/_portaudiomodule.c: At top level:
src/_portaudiomodule.c:575: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_pyAudio_paHostApiInfo_getseters’
src/_portaudiomodule.c:615: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_pyAudio_paHostApiInfoType’
src/_portaudiomodule.c: In function ‘_create_paHostApiInfo_object’:
src/_portaudiomodule.c:663: error: expected expression before ‘_pyAudio_paHostApiInfo’
src/_portaudiomodule.c: At top level:
src/_portaudiomodule.c:908: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
src/_portaudiomodule.c: In function ‘_is_open’:
src/_portaudiomodule.c:921: error: ‘_pyAudio_Stream’ has no member named ‘is_open’
src/_portaudiomodule.c: In function ‘_cleanup_Stream_object’:
src/_portaudiomodule.c:927: error: ‘_pyAudio_Stream’ has no member named ‘stream’
src/_portaudiomodule.c:928: error: ‘_pyAudio_Stream’ has no member named ‘stream’
src/_portaudiomodule.c:929: error: ‘_pyAudio_Stream’ has no member named ‘stream’
src/_portaudiomodule.c:932: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:933: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:935: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:936: warning: implicit declaration of function ‘free’
src/_portaudiomodule.c:936: warning: incompatible implicit declaration of built-in function ‘free’
src/_portaudiomodule.c:936: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:937: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:940: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:941: warning: incompatible implicit declaration of built-in function ‘free’
src/_portaudiomodule.c:941: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:942: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:946: error: ‘_pyAudio_Stream’ has no member named ‘is_open’
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_dealloc’:
src/_portaudiomodule.c:956: error: ‘_pyAudio_Stream’ has no member named ‘ob_type’
src/_portaudiomodule.c:956: error: ‘PyObject’ undeclared (first use in this function)
src/_portaudiomodule.c:956: error: expected expression before ‘)’ token
src/_portaudiomodule.c: At top level:
src/_portaudiomodule.c:960: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:984: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:1009: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:1034: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:1061: error: expected declaration specifiers or ‘...’ before ‘PyObject’
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_antiset’:
src/_portaudiomodule.c:1065: error: ‘PyExc_AttributeError’ undeclared (first use in this function)
src/_portaudiomodule.c: At top level:
src/_portaudiomodule.c:1070: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_pyAudio_Stream_getseters’
src/_portaudiomodule.c:1098: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_pyAudio_StreamType’
src/_portaudiomodule.c: In function ‘_create_Stream_object’:
src/_portaudiomodule.c:1146: error: expected expression before ‘_pyAudio_Stream’
src/_portaudiomodule.c: At top level:
src/_portaudiomodule.c:1162: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:1171: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:1172: error: expected ‘)’ before ‘*’ token
src/_portaudiomodule.c:1184: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:1206: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:1218: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:1245: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:1272: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:1300: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:1329: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:1361: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:1387: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:1416: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:1445: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:1473: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:1732: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:1749: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:1772: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:1847: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:1848: error: expected ‘)’ before ‘*’ token
src/_portaudiomodule.c:1890: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:1891: error: expected ‘)’ before ‘*’ token
src/_portaudiomodule.c:1932: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘u’
src/_portaudiomodule.c:1933: error: expected ‘)’ before ‘*’ token
src/_portaudiomodule.c:1972: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:2019: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:2064: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:2098: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:2126: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:2198: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:2288: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:2313: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/_portaudiomodule.c:2346: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘init_portaudio’
error: command 'gcc' failed with exit status 1

最佳答案

src/_portaudiomodule.c:30:20: error: Python.h: No such file or directory

您忘记安装 Python 开发文件。

关于python - 无法安装和构建 PyAudio,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4184262/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com