Pyaudio安装错误-'命令'gcc'失败,退出状态为 1

发布于 2024-11-05 19:38:24 字数 25478 浏览 1 评论 0原文

我正在运行 Ubuntu 11.04、Python 2.7.1 并想安装 Pyaudio。所以我

$ sudo easy_install pyaudio

在终端中运行,进程退出并显示以下错误消息,

Searching for pyaudio
Reading http://pypi.python.org/simple/pyaudio/
Reading http://people.csail.mit.edu/hubert/pyaudio/
Best match: pyaudio 0.2.4
Downloading http://people.csail.mit.edu/hubert/pyaudio/packages/pyaudio-0.2.4.tar.gz
Processing pyaudio-0.2.4.tar.gz
Running PyAudio-0.2.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-0Tetss/PyAudio-0.2.4/egg-dist-tmp-PYy9T8
In file included from /usr/include/python2.7/Python.h:8:0,
                 from src/_portaudiomodule.c:30:
/usr/include/python2.7/pyconfig.h:1155:0: warning: "_POSIX_C_SOURCE" redefined
/usr/include/features.h:214:0: note: this is the location of the previous definition
src/_portaudiomodule.c:31:23: fatal error: portaudio.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1

我不确定是否将其发布到 askubuntu.com 或 stackoveflow 中,但无论如何,它都在 stackoverflow 中。我也用谷歌搜索了一下这个问题,发现通过安装 python-dev 已经解决了一些问题。我已经安装了 python-dev。可能出了什么问题?

更新

以下是安装 libportaudio-dev 后出现的新错误,

Searching for pyaudio
Reading http://pypi.python.org/simple/pyaudio/
Reading http://people.csail.mit.edu/hubert/pyaudio/
Best match: pyaudio 0.2.4
Downloading http://people.csail.mit.edu/hubert/pyaudio/packages/pyaudio-0.2.4.tar.gz
Processing pyaudio-0.2.4.tar.gz
Running PyAudio-0.2.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-LMpsIy/PyAudio-0.2.4/egg-dist-tmp-AExlqd
In file included from /usr/include/python2.7/Python.h:8:0,
                 from src/_portaudiomodule.c:30:
/usr/include/python2.7/pyconfig.h:1155:0: warning: "_POSIX_C_SOURCE" redefined
/usr/include/features.h:214:0: note: this is the location of the previous definition
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_hostApi’:
src/_portaudiomodule.c:211:38: error: ‘PaDeviceInfo’ has no member named ‘hostApi’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultLowInputLatency’:
src/_portaudiomodule.c:253:42: error: ‘PaDeviceInfo’ has no member named ‘defaultLowInputLatency’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultLowOutputLatency’:
src/_portaudiomodule.c:267:42: error: ‘PaDeviceInfo’ has no member named ‘defaultLowOutputLatency’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultHighInputLatency’:
src/_portaudiomodule.c:282:42: error: ‘PaDeviceInfo’ has no member named ‘defaultHighInputLatency’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultHighOutputLatency’:
src/_portaudiomodule.c:296:42: error: ‘PaDeviceInfo’ has no member named ‘defaultHighOutputLatency’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultSampleRate’:
src/_portaudiomodule.c:310:42: error: ‘PaDeviceInfo’ has no member named ‘defaultSampleRate’
src/_portaudiomodule.c: At top level:
src/_portaudiomodule.c:465:3: error: expected specifier-qualifier-list before ‘PaHostApiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_structVersion’:
src/_portaudiomodule.c:475:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:481:29: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_type’:
src/_portaudiomodule.c:489:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:495:36: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_name’:
src/_portaudiomodule.c:503:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:503:32: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:509:34: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_deviceCount’:
src/_portaudiomodule.c:517:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:523:29: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_defaultInputDevice’:
src/_portaudiomodule.c:531:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:537:29: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_defaultOutputDevice’:
src/_portaudiomodule.c:545:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:551:29: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_dealloc’:
src/_portaudiomodule.c:569:7: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: At top level:
src/_portaudiomodule.c:910:3: error: expected specifier-qualifier-list before ‘PaStreamParameters’
src/_portaudiomodule.c: In function ‘_is_open’:
src/_portaudiomodule.c:921:23: error: ‘_pyAudio_Stream’ has no member named ‘is_open’
src/_portaudiomodule.c: In function ‘_cleanup_Stream_object’:
src/_portaudiomodule.c:932:19: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:933:17: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:935:19: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:936:22: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:937:17: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:940:19: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:941:22: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:942:17: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:946:15: error: ‘_pyAudio_Stream’ has no member named ‘is_open’
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_structVersion’:
src/_portaudiomodule.c:973:13: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:981:29: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_inputLatency’:
src/_portaudiomodule.c:998:13: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:1006:33: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_outputLatency’:
src/_portaudiomodule.c:1023:13: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:1031:33: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_sampleRate’:
src/_portaudiomodule.c:1048:13: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:1056:33: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘pa_get_version’:
src/_portaudiomodule.c:1168:3: warning: implicit declaration of function ‘Pa_GetVersion’
src/_portaudiomodule.c: In function ‘pa_get_version_text’:
src/_portaudiomodule.c:1177:3: warning: implicit declaration of function ‘Pa_GetVersionText’
src/_portaudiomodule.c:1177:3: warning: passing argument 1 of ‘PyString_FromString’ makes pointer from integer without a cast
/usr/include/python2.7/stringobject.h:63:24: note: expected ‘const char *’ but argument is of type ‘int’
src/_portaudiomodule.c: In function ‘pa_get_host_api_count’:
src/_portaudiomodule.c:1221:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1221:3: note: each undeclared identifier is reported only once for each function it appears in
src/_portaudiomodule.c:1221:18: error: expected ‘;’ before ‘count’
src/_portaudiomodule.c:1226:3: error: ‘count’ undeclared (first use in this function)
src/_portaudiomodule.c:1226:3: warning: implicit declaration of function ‘Pa_GetHostApiCount’
src/_portaudiomodule.c: In function ‘pa_get_default_host_api’:
src/_portaudiomodule.c:1248:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1248:18: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1253:3: warning: implicit declaration of function ‘Pa_GetDefaultHostApi’
src/_portaudiomodule.c:1253:3: error: lvalue required as left operand of assignment
src/_portaudiomodule.c:1265:7: warning: passing argument 1 of ‘Pa_GetErrorText’ makes integer from pointer without a cast
/usr/include/portaudio.h:93:13: note: expected ‘PaError’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1269:3: warning: passing argument 1 of ‘PyInt_FromLong’ makes integer from pointer without a cast
/usr/include/python2.7/intobject.h:38:24: note: expected ‘long int’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c: In function ‘pa_host_api_type_id_to_host_api_index’:
src/_portaudiomodule.c:1275:3: error: ‘PaHostApiTypeId’ undeclared (first use in this function)
src/_portaudiomodule.c:1275:19: error: expected ‘;’ before ‘typeid’
src/_portaudiomodule.c:1276:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1276:18: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1278:37: error: ‘typeid’ undeclared (first use in this function)
src/_portaudiomodule.c:1281:3: warning: implicit declaration of function ‘Pa_HostApiTypeIdToHostApiIndex’
src/_portaudiomodule.c:1293:7: warning: passing argument 1 of ‘Pa_GetErrorText’ makes integer from pointer without a cast
/usr/include/portaudio.h:93:13: note: expected ‘PaError’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1297:3: warning: passing argument 1 of ‘PyInt_FromLong’ makes integer from pointer without a cast
/usr/include/python2.7/intobject.h:38:24: note: expected ‘long int’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c: In function ‘pa_host_api_device_index_to_device_index’:
src/_portaudiomodule.c:1303:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1303:18: error: expected ‘;’ before ‘apiIndex’
src/_portaudiomodule.c:1305:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1305:17: error: expected ‘;’ before ‘devIndex’
src/_portaudiomodule.c:1308:38: error: ‘apiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1311:3: error: ‘devIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1311:3: warning: implicit declaration of function ‘Pa_HostApiDeviceIndexToDeviceIndex’
src/_portaudiomodule.c: In function ‘pa_get_host_api_info’:
src/_portaudiomodule.c:1332:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1332:18: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1333:3: error: ‘PaHostApiInfo’ undeclared (first use in this function)
src/_portaudiomodule.c:1333:18: error: ‘_info’ undeclared (first use in this function)
src/_portaudiomodule.c:1339:27: error: expected expression before ‘)’ token
src/_portaudiomodule.c:1345:7: error: ‘paInvalidHostApi’ undeclared (first use in this function)
src/_portaudiomodule.c:1350:10: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘pa_get_device_count’:
src/_portaudiomodule.c:1364:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1364:17: error: expected ‘;’ before ‘count’
src/_portaudiomodule.c:1369:3: error: ‘count’ undeclared (first use in this function)
src/_portaudiomodule.c:1369:3: warning: implicit declaration of function ‘Pa_GetDeviceCount’
src/_portaudiomodule.c: In function ‘pa_get_default_input_device’:
src/_portaudiomodule.c:1390:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1390:17: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1395:3: warning: implicit declaration of function ‘Pa_GetDefaultInputDevice’
src/_portaudiomodule.c:1395:3: error: lvalue required as left operand of assignment
src/_portaudiomodule.c:1396:13: warning: comparison between pointer and integer
src/_portaudiomodule.c:1409:7: warning: passing argument 1 of ‘Pa_GetErrorText’ makes integer from pointer without a cast
/usr/include/portaudio.h:93:13: note: expected ‘PaError’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1413:3: warning: passing argument 1 of ‘PyInt_FromLong’ makes integer from pointer without a cast
/usr/include/python2.7/intobject.h:38:24: note: expected ‘long int’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c: In function ‘pa_get_default_output_device’:
src/_portaudiomodule.c:1419:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1419:17: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1424:3: warning: implicit declaration of function ‘Pa_GetDefaultOutputDevice’
src/_portaudiomodule.c:1424:3: error: lvalue required as left operand of assignment
src/_portaudiomodule.c:1425:13: warning: comparison between pointer and integer
src/_portaudiomodule.c:1438:7: warning: passing argument 1 of ‘Pa_GetErrorText’ makes integer from pointer without a cast
/usr/include/portaudio.h:93:13: note: expected ‘PaError’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1442:3: warning: passing argument 1 of ‘PyInt_FromLong’ makes integer from pointer without a cast
/usr/include/python2.7/intobject.h:38:24: note: expected ‘long int’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c: In function ‘pa_get_device_info’:
src/_portaudiomodule.c:1448:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1448:17: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1455:3: warning: passing argument 1 of ‘Pa_GetDeviceInfo’ makes integer from pointer without a cast
/usr/include/portaudio.h:182:21: note: expected ‘PaDeviceID’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1460:30: error: ‘paInvalidDevice’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_open’:
src/_portaudiomodule.c:1601:3: error: ‘PaStreamParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:1601:23: error: ‘outputParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:1602:23: error: ‘inputParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:1606:28: error: expected expression before ‘)’ token
src/_portaudiomodule.c:1622:9: error: ‘paInvalidDevice’ undeclared (first use in this function)
src/_portaudiomodule.c:1643:28: error: expected expression before ‘)’ token
src/_portaudiomodule.c:1679:3: error: ‘PaStreamInfo’ undeclared (first use in this function)
src/_portaudiomodule.c:1679:17: error: ‘streamInfo’ undeclared (first use in this function)
src/_portaudiomodule.c:1696:9: warning: passing argument 5 of ‘Pa_OpenStream’ makes pointer from integer without a cast
/usr/include/portaudio.h:325:9: note: expected ‘void *’ but argument is of type ‘int’
src/_portaudiomodule.c:1696:9: warning: passing argument 7 of ‘Pa_OpenStream’ makes integer from pointer without a cast
/usr/include/portaudio.h:325:9: note: expected ‘int’ but argument is of type ‘void *’
src/_portaudiomodule.c:1696:9: warning: passing argument 8 of ‘Pa_OpenStream’ makes integer from pointer without a cast
/usr/include/portaudio.h:325:9: note: expected ‘PaSampleFormat’ but argument is of type ‘void *’
src/_portaudiomodule.c:1696:9: error: too few arguments to function ‘Pa_OpenStream’
/usr/include/portaudio.h:325:9: note: declared here
src/_portaudiomodule.c:1712:31: error: expected expression before ‘)’ token
src/_portaudiomodule.c:1724:15: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:1725:15: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:1726:15: error: ‘_pyAudio_Stream’ has no member named ‘is_open’
src/_portaudiomodule.c:1727:15: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘pa_is_format_supported’:
src/_portaudiomodule.c:1791:3: error: ‘PaStreamParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:1791:22: error: expected ‘;’ before ‘inputParams’
src/_portaudiomodule.c:1792:22: error: expected ‘;’ before ‘outputParams’
src/_portaudiomodule.c:1812:5: error: ‘inputParams’ undeclared (first use in this function)
src/_portaudiomodule.c:1820:5: error: ‘outputParams’ undeclared (first use in this function)
src/_portaudiomodule.c:1827:3: warning: implicit declaration of function ‘Pa_IsFormatSupported’
src/_portaudiomodule.c:1831:16: error: ‘paFormatIsSupported’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_start_stream’:
src/_portaudiomodule.c:1870:16: error: ‘paStreamIsNotStopped’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_stop_stream’:
src/_portaudiomodule.c:1911:16: error: ‘paStreamIsStopped’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_abort_stream’:
src/_portaudiomodule.c:1952:16: error: ‘paStreamIsStopped’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_is_stream_stopped’:
src/_portaudiomodule.c:1994:3: warning: implicit declaration of function ‘Pa_IsStreamStopped’
src/_portaudiomodule.c: In function ‘pa_is_stream_active’:
src/_portaudiomodule.c:2039:3: warning: implicit declaration of function ‘Pa_IsStreamActive’
src/_portaudiomodule.c: In function ‘pa_get_stream_time’:
src/_portaudiomodule.c:2086:3: warning: implicit declaration of function ‘Pa_GetStreamTime’
src/_portaudiomodule.c: In function ‘pa_get_stream_cpu_load’:
src/_portaudiomodule.c:2118:3: warning: implicit declaration of function ‘Pa_GetStreamCpuLoad’
src/_portaudiomodule.c: In function ‘pa_write_stream’:
src/_portaudiomodule.c:2167:3: warning: implicit declaration of function ‘Pa_WriteStream’
src/_portaudiomodule.c:2171:16: error: ‘paOutputUnderflowed’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_read_stream’:
src/_portaudiomodule.c:2233:3: error: ‘PaStreamParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:2233:23: error: ‘inputParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:2233:53: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:2253:3: warning: implicit declaration of function ‘Pa_ReadStream’
src/_portaudiomodule.c:2259:15: error: ‘paInputOverflowed’ undeclared (first use in this function)
src/_portaudiomodule.c:2265:22: error: ‘paOutputUnderflowed’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_get_stream_write_available’:
src/_portaudiomodule.c:2309:3: warning: implicit declaration of function ‘Pa_GetStreamWriteAvailable’
src/_portaudiomodule.c: In function ‘pa_get_stream_read_available’:
src/_portaudiomodule.c:2334:3: warning: implicit declaration of function ‘Pa_GetStreamReadAvailable’
src/_portaudiomodule.c: In function ‘init_portaudio’:
src/_portaudiomodule.c:2384:49: error: ‘paInDevelopment’ undeclared (first use in this function)
src/_portaudiomodule.c:2385:47: error: ‘paDirectSound’ undeclared (first use in this function)
src/_portaudiomodule.c:2386:39: error: ‘paMME’ undeclared (first use in this function)
src/_portaudiomodule.c:2387:40: error: ‘paASIO’ undeclared (first use in this function)
src/_portaudiomodule.c:2388:48: error: ‘paSoundManager’ undeclared (first use in this function)
src/_portaudiomodule.c:2389:45: error: ‘paCoreAudio’ undeclared (first use in this function)
src/_portaudiomodule.c:2390:39: error: ‘paOSS’ undeclared (first use in this function)
src/_portaudiomodule.c:2391:40: error: ‘paALSA’ undeclared (first use in this function)
src/_portaudiomodule.c:2392:38: error: ‘paAL’ undeclared (first use in this function)
src/_portaudiomodule.c:2393:40: error: ‘paBeOS’ undeclared (first use in this function)
src/_portaudiomodule.c:2394:41: error: ‘paWDMKS’ undeclared (first use in this function)
src/_portaudiomodule.c:2395:40: error: ‘paJACK’ undeclared (first use in this function)
src/_portaudiomodule.c:2396:42: error: ‘paWASAPI’ undeclared (first use in this function)
src/_portaudiomodule.c:2410:50: error: ‘paNotInitialized’ undeclared (first use in this function)
src/_portaudiomodule.c:2412:6: error: ‘paUnanticipatedHostError’ undeclared (first use in this function)
src/_portaudiomodule.c:2417:49: error: ‘paInvalidDevice’ undeclared (first use in this function)
src/_portaudiomodule.c:2433:6: error: ‘paIncompatibleHostApiSpecificStreamInfo’ undeclared (first use in this function)
src/_portaudiomodule.c:2434:51: error: ‘paStreamIsStopped’ undeclared (first use in this function)
src/_portaudiomodule.c:2435:54: error: ‘paStreamIsNotStopped’ undeclared (first use in this function)
src/_portaudiomodule.c:2436:51: error: ‘paInputOverflowed’ undeclared (first use in this function)
src/_portaudiomodule.c:2437:53: error: ‘paOutputUnderflowed’ undeclared (first use in this function)
src/_portaudiomodule.c:2438:51: error: ‘paHostApiNotFound’ undeclared (first use in this function)
src/_portaudiomodule.c:2439:50: error: ‘paInvalidHostApi’ undeclared (first use in this function)
src/_portaudiomodule.c:2441:6: error: ‘paCanNotReadFromACallbackStream’ undeclared (first use in this function)
src/_portaudiomodule.c:2443:6: error: ‘paCanNotWriteToACallbackStream’ undeclared (first use in this function)
src/_portaudiomodule.c:2445:6: error: ‘paCanNotReadFromAnOutputOnlyStream’ undeclared (first use in this function)
src/_portaudiomodule.c:2447:6: error: ‘paCanNotWriteToAnInputOnlyStream’ undeclared (first use in this function)
src/_portaudiomodule.c:2449:6: error: ‘paIncompatibleStreamHostApi’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_defaultOutputDevice’:
src/_portaudiomodule.c:552:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_defaultInputDevice’:
src/_portaudiomodule.c:538:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_deviceCount’:
src/_portaudiomodule.c:524:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_type’:
src/_portaudiomodule.c:496:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_structVersion’:
src/_portaudiomodule.c:482:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_name’:
src/_portaudiomodule.c:510:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultSampleRate’:
src/_portaudiomodule.c:311:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultHighOutputLatency’:
src/_portaudiomodule.c:297:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultHighInputLatency’:
src/_portaudiomodule.c:283:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultLowOutputLatency’:
src/_portaudiomodule.c:268:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultLowInputLatency’:
src/_portaudiomodule.c:254:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_hostApi’:
src/_portaudiomodule.c:212:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_sampleRate’:
src/_portaudiomodule.c:1057:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_is_open’:
src/_portaudiomodule.c:922:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_outputLatency’:
src/_portaudiomodule.c:1032:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_inputLatency’:
src/_portaudiomodule.c:1007:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_structVersion’:
src/_portaudiomodule.c:982:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘pa_is_format_supported’:
src/_portaudiomodule.c:1841:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘pa_get_device_count’:
src/_portaudiomodule.c:1385:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘pa_host_api_device_index_to_device_index’:
src/_portaudiomodule.c:1327:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘pa_get_host_api_count’:
src/_portaudiomodule.c:1243:1: warning: control reaches end of non-void function
error: Setup script exited with error: command 'gcc' failed with exit status 1

I'm running Ubuntu 11.04, Python 2.7.1 and wanted to install Pyaudio. So I ran,

$ sudo easy_install pyaudio

in the terminal and the process exited with following error messages,

Searching for pyaudio
Reading http://pypi.python.org/simple/pyaudio/
Reading http://people.csail.mit.edu/hubert/pyaudio/
Best match: pyaudio 0.2.4
Downloading http://people.csail.mit.edu/hubert/pyaudio/packages/pyaudio-0.2.4.tar.gz
Processing pyaudio-0.2.4.tar.gz
Running PyAudio-0.2.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-0Tetss/PyAudio-0.2.4/egg-dist-tmp-PYy9T8
In file included from /usr/include/python2.7/Python.h:8:0,
                 from src/_portaudiomodule.c:30:
/usr/include/python2.7/pyconfig.h:1155:0: warning: "_POSIX_C_SOURCE" redefined
/usr/include/features.h:214:0: note: this is the location of the previous definition
src/_portaudiomodule.c:31:23: fatal error: portaudio.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1

I wasn't sure whether to post this on askubuntu.com or here in stackoveflow, but anyway here it is in stackoverflow. Also I google'd a bit this question and found by installing python-dev have solved the problem for some. I've already installed python-dev. What may have gone wrong?

UPDATE

Following are the new errors I get after installing libportaudio-dev,

Searching for pyaudio
Reading http://pypi.python.org/simple/pyaudio/
Reading http://people.csail.mit.edu/hubert/pyaudio/
Best match: pyaudio 0.2.4
Downloading http://people.csail.mit.edu/hubert/pyaudio/packages/pyaudio-0.2.4.tar.gz
Processing pyaudio-0.2.4.tar.gz
Running PyAudio-0.2.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-LMpsIy/PyAudio-0.2.4/egg-dist-tmp-AExlqd
In file included from /usr/include/python2.7/Python.h:8:0,
                 from src/_portaudiomodule.c:30:
/usr/include/python2.7/pyconfig.h:1155:0: warning: "_POSIX_C_SOURCE" redefined
/usr/include/features.h:214:0: note: this is the location of the previous definition
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_hostApi’:
src/_portaudiomodule.c:211:38: error: ‘PaDeviceInfo’ has no member named ‘hostApi’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultLowInputLatency’:
src/_portaudiomodule.c:253:42: error: ‘PaDeviceInfo’ has no member named ‘defaultLowInputLatency’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultLowOutputLatency’:
src/_portaudiomodule.c:267:42: error: ‘PaDeviceInfo’ has no member named ‘defaultLowOutputLatency’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultHighInputLatency’:
src/_portaudiomodule.c:282:42: error: ‘PaDeviceInfo’ has no member named ‘defaultHighInputLatency’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultHighOutputLatency’:
src/_portaudiomodule.c:296:42: error: ‘PaDeviceInfo’ has no member named ‘defaultHighOutputLatency’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultSampleRate’:
src/_portaudiomodule.c:310:42: error: ‘PaDeviceInfo’ has no member named ‘defaultSampleRate’
src/_portaudiomodule.c: At top level:
src/_portaudiomodule.c:465:3: error: expected specifier-qualifier-list before ‘PaHostApiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_structVersion’:
src/_portaudiomodule.c:475:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:481:29: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_type’:
src/_portaudiomodule.c:489:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:495:36: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_name’:
src/_portaudiomodule.c:503:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:503:32: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:509:34: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_deviceCount’:
src/_portaudiomodule.c:517:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:523:29: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_defaultInputDevice’:
src/_portaudiomodule.c:531:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:537:29: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_defaultOutputDevice’:
src/_portaudiomodule.c:545:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:551:29: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_dealloc’:
src/_portaudiomodule.c:569:7: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: At top level:
src/_portaudiomodule.c:910:3: error: expected specifier-qualifier-list before ‘PaStreamParameters’
src/_portaudiomodule.c: In function ‘_is_open’:
src/_portaudiomodule.c:921:23: error: ‘_pyAudio_Stream’ has no member named ‘is_open’
src/_portaudiomodule.c: In function ‘_cleanup_Stream_object’:
src/_portaudiomodule.c:932:19: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:933:17: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:935:19: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:936:22: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:937:17: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:940:19: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:941:22: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:942:17: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:946:15: error: ‘_pyAudio_Stream’ has no member named ‘is_open’
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_structVersion’:
src/_portaudiomodule.c:973:13: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:981:29: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_inputLatency’:
src/_portaudiomodule.c:998:13: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:1006:33: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_outputLatency’:
src/_portaudiomodule.c:1023:13: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:1031:33: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_sampleRate’:
src/_portaudiomodule.c:1048:13: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:1056:33: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘pa_get_version’:
src/_portaudiomodule.c:1168:3: warning: implicit declaration of function ‘Pa_GetVersion’
src/_portaudiomodule.c: In function ‘pa_get_version_text’:
src/_portaudiomodule.c:1177:3: warning: implicit declaration of function ‘Pa_GetVersionText’
src/_portaudiomodule.c:1177:3: warning: passing argument 1 of ‘PyString_FromString’ makes pointer from integer without a cast
/usr/include/python2.7/stringobject.h:63:24: note: expected ‘const char *’ but argument is of type ‘int’
src/_portaudiomodule.c: In function ‘pa_get_host_api_count’:
src/_portaudiomodule.c:1221:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1221:3: note: each undeclared identifier is reported only once for each function it appears in
src/_portaudiomodule.c:1221:18: error: expected ‘;’ before ‘count’
src/_portaudiomodule.c:1226:3: error: ‘count’ undeclared (first use in this function)
src/_portaudiomodule.c:1226:3: warning: implicit declaration of function ‘Pa_GetHostApiCount’
src/_portaudiomodule.c: In function ‘pa_get_default_host_api’:
src/_portaudiomodule.c:1248:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1248:18: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1253:3: warning: implicit declaration of function ‘Pa_GetDefaultHostApi’
src/_portaudiomodule.c:1253:3: error: lvalue required as left operand of assignment
src/_portaudiomodule.c:1265:7: warning: passing argument 1 of ‘Pa_GetErrorText’ makes integer from pointer without a cast
/usr/include/portaudio.h:93:13: note: expected ‘PaError’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1269:3: warning: passing argument 1 of ‘PyInt_FromLong’ makes integer from pointer without a cast
/usr/include/python2.7/intobject.h:38:24: note: expected ‘long int’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c: In function ‘pa_host_api_type_id_to_host_api_index’:
src/_portaudiomodule.c:1275:3: error: ‘PaHostApiTypeId’ undeclared (first use in this function)
src/_portaudiomodule.c:1275:19: error: expected ‘;’ before ‘typeid’
src/_portaudiomodule.c:1276:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1276:18: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1278:37: error: ‘typeid’ undeclared (first use in this function)
src/_portaudiomodule.c:1281:3: warning: implicit declaration of function ‘Pa_HostApiTypeIdToHostApiIndex’
src/_portaudiomodule.c:1293:7: warning: passing argument 1 of ‘Pa_GetErrorText’ makes integer from pointer without a cast
/usr/include/portaudio.h:93:13: note: expected ‘PaError’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1297:3: warning: passing argument 1 of ‘PyInt_FromLong’ makes integer from pointer without a cast
/usr/include/python2.7/intobject.h:38:24: note: expected ‘long int’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c: In function ‘pa_host_api_device_index_to_device_index’:
src/_portaudiomodule.c:1303:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1303:18: error: expected ‘;’ before ‘apiIndex’
src/_portaudiomodule.c:1305:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1305:17: error: expected ‘;’ before ‘devIndex’
src/_portaudiomodule.c:1308:38: error: ‘apiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1311:3: error: ‘devIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1311:3: warning: implicit declaration of function ‘Pa_HostApiDeviceIndexToDeviceIndex’
src/_portaudiomodule.c: In function ‘pa_get_host_api_info’:
src/_portaudiomodule.c:1332:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1332:18: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1333:3: error: ‘PaHostApiInfo’ undeclared (first use in this function)
src/_portaudiomodule.c:1333:18: error: ‘_info’ undeclared (first use in this function)
src/_portaudiomodule.c:1339:27: error: expected expression before ‘)’ token
src/_portaudiomodule.c:1345:7: error: ‘paInvalidHostApi’ undeclared (first use in this function)
src/_portaudiomodule.c:1350:10: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘pa_get_device_count’:
src/_portaudiomodule.c:1364:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1364:17: error: expected ‘;’ before ‘count’
src/_portaudiomodule.c:1369:3: error: ‘count’ undeclared (first use in this function)
src/_portaudiomodule.c:1369:3: warning: implicit declaration of function ‘Pa_GetDeviceCount’
src/_portaudiomodule.c: In function ‘pa_get_default_input_device’:
src/_portaudiomodule.c:1390:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1390:17: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1395:3: warning: implicit declaration of function ‘Pa_GetDefaultInputDevice’
src/_portaudiomodule.c:1395:3: error: lvalue required as left operand of assignment
src/_portaudiomodule.c:1396:13: warning: comparison between pointer and integer
src/_portaudiomodule.c:1409:7: warning: passing argument 1 of ‘Pa_GetErrorText’ makes integer from pointer without a cast
/usr/include/portaudio.h:93:13: note: expected ‘PaError’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1413:3: warning: passing argument 1 of ‘PyInt_FromLong’ makes integer from pointer without a cast
/usr/include/python2.7/intobject.h:38:24: note: expected ‘long int’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c: In function ‘pa_get_default_output_device’:
src/_portaudiomodule.c:1419:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1419:17: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1424:3: warning: implicit declaration of function ‘Pa_GetDefaultOutputDevice’
src/_portaudiomodule.c:1424:3: error: lvalue required as left operand of assignment
src/_portaudiomodule.c:1425:13: warning: comparison between pointer and integer
src/_portaudiomodule.c:1438:7: warning: passing argument 1 of ‘Pa_GetErrorText’ makes integer from pointer without a cast
/usr/include/portaudio.h:93:13: note: expected ‘PaError’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1442:3: warning: passing argument 1 of ‘PyInt_FromLong’ makes integer from pointer without a cast
/usr/include/python2.7/intobject.h:38:24: note: expected ‘long int’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c: In function ‘pa_get_device_info’:
src/_portaudiomodule.c:1448:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1448:17: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1455:3: warning: passing argument 1 of ‘Pa_GetDeviceInfo’ makes integer from pointer without a cast
/usr/include/portaudio.h:182:21: note: expected ‘PaDeviceID’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1460:30: error: ‘paInvalidDevice’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_open’:
src/_portaudiomodule.c:1601:3: error: ‘PaStreamParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:1601:23: error: ‘outputParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:1602:23: error: ‘inputParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:1606:28: error: expected expression before ‘)’ token
src/_portaudiomodule.c:1622:9: error: ‘paInvalidDevice’ undeclared (first use in this function)
src/_portaudiomodule.c:1643:28: error: expected expression before ‘)’ token
src/_portaudiomodule.c:1679:3: error: ‘PaStreamInfo’ undeclared (first use in this function)
src/_portaudiomodule.c:1679:17: error: ‘streamInfo’ undeclared (first use in this function)
src/_portaudiomodule.c:1696:9: warning: passing argument 5 of ‘Pa_OpenStream’ makes pointer from integer without a cast
/usr/include/portaudio.h:325:9: note: expected ‘void *’ but argument is of type ‘int’
src/_portaudiomodule.c:1696:9: warning: passing argument 7 of ‘Pa_OpenStream’ makes integer from pointer without a cast
/usr/include/portaudio.h:325:9: note: expected ‘int’ but argument is of type ‘void *’
src/_portaudiomodule.c:1696:9: warning: passing argument 8 of ‘Pa_OpenStream’ makes integer from pointer without a cast
/usr/include/portaudio.h:325:9: note: expected ‘PaSampleFormat’ but argument is of type ‘void *’
src/_portaudiomodule.c:1696:9: error: too few arguments to function ‘Pa_OpenStream’
/usr/include/portaudio.h:325:9: note: declared here
src/_portaudiomodule.c:1712:31: error: expected expression before ‘)’ token
src/_portaudiomodule.c:1724:15: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:1725:15: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:1726:15: error: ‘_pyAudio_Stream’ has no member named ‘is_open’
src/_portaudiomodule.c:1727:15: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘pa_is_format_supported’:
src/_portaudiomodule.c:1791:3: error: ‘PaStreamParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:1791:22: error: expected ‘;’ before ‘inputParams’
src/_portaudiomodule.c:1792:22: error: expected ‘;’ before ‘outputParams’
src/_portaudiomodule.c:1812:5: error: ‘inputParams’ undeclared (first use in this function)
src/_portaudiomodule.c:1820:5: error: ‘outputParams’ undeclared (first use in this function)
src/_portaudiomodule.c:1827:3: warning: implicit declaration of function ‘Pa_IsFormatSupported’
src/_portaudiomodule.c:1831:16: error: ‘paFormatIsSupported’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_start_stream’:
src/_portaudiomodule.c:1870:16: error: ‘paStreamIsNotStopped’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_stop_stream’:
src/_portaudiomodule.c:1911:16: error: ‘paStreamIsStopped’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_abort_stream’:
src/_portaudiomodule.c:1952:16: error: ‘paStreamIsStopped’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_is_stream_stopped’:
src/_portaudiomodule.c:1994:3: warning: implicit declaration of function ‘Pa_IsStreamStopped’
src/_portaudiomodule.c: In function ‘pa_is_stream_active’:
src/_portaudiomodule.c:2039:3: warning: implicit declaration of function ‘Pa_IsStreamActive’
src/_portaudiomodule.c: In function ‘pa_get_stream_time’:
src/_portaudiomodule.c:2086:3: warning: implicit declaration of function ‘Pa_GetStreamTime’
src/_portaudiomodule.c: In function ‘pa_get_stream_cpu_load’:
src/_portaudiomodule.c:2118:3: warning: implicit declaration of function ‘Pa_GetStreamCpuLoad’
src/_portaudiomodule.c: In function ‘pa_write_stream’:
src/_portaudiomodule.c:2167:3: warning: implicit declaration of function ‘Pa_WriteStream’
src/_portaudiomodule.c:2171:16: error: ‘paOutputUnderflowed’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_read_stream’:
src/_portaudiomodule.c:2233:3: error: ‘PaStreamParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:2233:23: error: ‘inputParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:2233:53: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:2253:3: warning: implicit declaration of function ‘Pa_ReadStream’
src/_portaudiomodule.c:2259:15: error: ‘paInputOverflowed’ undeclared (first use in this function)
src/_portaudiomodule.c:2265:22: error: ‘paOutputUnderflowed’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_get_stream_write_available’:
src/_portaudiomodule.c:2309:3: warning: implicit declaration of function ‘Pa_GetStreamWriteAvailable’
src/_portaudiomodule.c: In function ‘pa_get_stream_read_available’:
src/_portaudiomodule.c:2334:3: warning: implicit declaration of function ‘Pa_GetStreamReadAvailable’
src/_portaudiomodule.c: In function ‘init_portaudio’:
src/_portaudiomodule.c:2384:49: error: ‘paInDevelopment’ undeclared (first use in this function)
src/_portaudiomodule.c:2385:47: error: ‘paDirectSound’ undeclared (first use in this function)
src/_portaudiomodule.c:2386:39: error: ‘paMME’ undeclared (first use in this function)
src/_portaudiomodule.c:2387:40: error: ‘paASIO’ undeclared (first use in this function)
src/_portaudiomodule.c:2388:48: error: ‘paSoundManager’ undeclared (first use in this function)
src/_portaudiomodule.c:2389:45: error: ‘paCoreAudio’ undeclared (first use in this function)
src/_portaudiomodule.c:2390:39: error: ‘paOSS’ undeclared (first use in this function)
src/_portaudiomodule.c:2391:40: error: ‘paALSA’ undeclared (first use in this function)
src/_portaudiomodule.c:2392:38: error: ‘paAL’ undeclared (first use in this function)
src/_portaudiomodule.c:2393:40: error: ‘paBeOS’ undeclared (first use in this function)
src/_portaudiomodule.c:2394:41: error: ‘paWDMKS’ undeclared (first use in this function)
src/_portaudiomodule.c:2395:40: error: ‘paJACK’ undeclared (first use in this function)
src/_portaudiomodule.c:2396:42: error: ‘paWASAPI’ undeclared (first use in this function)
src/_portaudiomodule.c:2410:50: error: ‘paNotInitialized’ undeclared (first use in this function)
src/_portaudiomodule.c:2412:6: error: ‘paUnanticipatedHostError’ undeclared (first use in this function)
src/_portaudiomodule.c:2417:49: error: ‘paInvalidDevice’ undeclared (first use in this function)
src/_portaudiomodule.c:2433:6: error: ‘paIncompatibleHostApiSpecificStreamInfo’ undeclared (first use in this function)
src/_portaudiomodule.c:2434:51: error: ‘paStreamIsStopped’ undeclared (first use in this function)
src/_portaudiomodule.c:2435:54: error: ‘paStreamIsNotStopped’ undeclared (first use in this function)
src/_portaudiomodule.c:2436:51: error: ‘paInputOverflowed’ undeclared (first use in this function)
src/_portaudiomodule.c:2437:53: error: ‘paOutputUnderflowed’ undeclared (first use in this function)
src/_portaudiomodule.c:2438:51: error: ‘paHostApiNotFound’ undeclared (first use in this function)
src/_portaudiomodule.c:2439:50: error: ‘paInvalidHostApi’ undeclared (first use in this function)
src/_portaudiomodule.c:2441:6: error: ‘paCanNotReadFromACallbackStream’ undeclared (first use in this function)
src/_portaudiomodule.c:2443:6: error: ‘paCanNotWriteToACallbackStream’ undeclared (first use in this function)
src/_portaudiomodule.c:2445:6: error: ‘paCanNotReadFromAnOutputOnlyStream’ undeclared (first use in this function)
src/_portaudiomodule.c:2447:6: error: ‘paCanNotWriteToAnInputOnlyStream’ undeclared (first use in this function)
src/_portaudiomodule.c:2449:6: error: ‘paIncompatibleStreamHostApi’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_defaultOutputDevice’:
src/_portaudiomodule.c:552:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_defaultInputDevice’:
src/_portaudiomodule.c:538:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_deviceCount’:
src/_portaudiomodule.c:524:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_type’:
src/_portaudiomodule.c:496:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_structVersion’:
src/_portaudiomodule.c:482:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_name’:
src/_portaudiomodule.c:510:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultSampleRate’:
src/_portaudiomodule.c:311:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultHighOutputLatency’:
src/_portaudiomodule.c:297:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultHighInputLatency’:
src/_portaudiomodule.c:283:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultLowOutputLatency’:
src/_portaudiomodule.c:268:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultLowInputLatency’:
src/_portaudiomodule.c:254:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_hostApi’:
src/_portaudiomodule.c:212:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_sampleRate’:
src/_portaudiomodule.c:1057:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_is_open’:
src/_portaudiomodule.c:922:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_outputLatency’:
src/_portaudiomodule.c:1032:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_inputLatency’:
src/_portaudiomodule.c:1007:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_structVersion’:
src/_portaudiomodule.c:982:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘pa_is_format_supported’:
src/_portaudiomodule.c:1841:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘pa_get_device_count’:
src/_portaudiomodule.c:1385:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘pa_host_api_device_index_to_device_index’:
src/_portaudiomodule.c:1327:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘pa_get_host_api_count’:
src/_portaudiomodule.c:1243:1: warning: control reaches end of non-void function
error: Setup script exited with error: command 'gcc' failed with exit status 1

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

临风闻羌笛 2024-11-12 19:38:24

好吧,我通过使用包管理器解决了这个问题,

 $ sudo apt-get install python-pyaudio

尽管仍然不知道为什么 easy_install 失败。

Well, I solved the problem by using the package manager,

 $ sudo apt-get install python-pyaudio

Although still has no clue why easy_install fails.

幻梦 2024-11-12 19:38:24

在 ubuntu 13.10 又名 Saucy Salamander 上,我通过安装 libjack-jackd2-devportaudio19-dev 解决了这个问题。

sudo apt-get install libjack-jackd2-dev portaudio19-dev

然后 pip install pyaudio 应该可以工作。

On ubuntu 13.10 aka Saucy Salamander, I solved the problem by installing libjack-jackd2-dev and portaudio19-dev.

sudo apt-get install libjack-jackd2-dev portaudio19-dev

Then pip install pyaudio should work.

花开半夏魅人心 2024-11-12 19:38:24

我安装在我的 virtualenv 中。 pyaudio (0.2.11)

  1. pip install pyaudio ->错误
  2. sudo apt-get install portaudio19-dev ->成功
  3. pip install pyaudio ->成功

I install in my virtualenv. pyaudio (0.2.11)

  1. pip install pyaudio -> error
  2. sudo apt-get install portaudio19-dev -> success
  3. pip install pyaudio -> success
隔岸观火 2024-11-12 19:38:24

这就是我如何让它工作:

  1. brew update(如果您的brew是最新的,您可以忽略此步骤)
  2. brew install portaudiobrew
  3. link --overwrite portaudio
  4. sudo python2.7 -m pip install --global-option='build_ext' --global-option='-I/usr/local/include' --global-option='-L/usr/local/lib' pyaudio

This is how I get it work:

  1. brew update (you can ignore this step if your brew is up to date)
  2. brew install portaudio
  3. brew link --overwrite portaudio
  4. sudo python2.7 -m pip install --global-option='build_ext' --global-option='-I/usr/local/include' --global-option='-L/usr/local/lib' pyaudio
可是我不能没有你 2024-11-12 19:38:24

在 Fedora 27 上,为了从默认的 python3 安装中获取 pyaudio,我执行了以下操作

sudo dnf install python3-devel
sudo dnf install portaudio-devel
sudo pip3 install pyaudio

On Fedora 27 in order to get pyaudio from a default python3 installation I did the following

sudo dnf install python3-devel
sudo dnf install portaudio-devel
sudo pip3 install pyaudio
離殇 2024-11-12 19:38:24

也有同样的问题。我正在研究 MAC,并通过运行这些代码行解决了这个问题。

brew 安装 portaudio

pip 安装 pyaudio

Had the same problem too. I'm working on a MAC and solved the issue by running these lines of code.

brew install portaudio

pip install pyaudio

最近可好 2024-11-12 19:38:24

使用以下命令安装pyaudio

sudo apt-get install python-pyaudio

Use the following command to install pyaudio

sudo apt-get install python-pyaudio
╭⌒浅淡时光〆 2024-11-12 19:38:24

我在 OpenSuse (13.2) 上遇到类似错误后发现了这个问题。所以我想我也应该发布我的解决方案,以防其他人通过谷歌找到这个。

尽管 libportaudio2 是包含库的软件包,但您还需要 portaudio-devel 才能使安装工作。

I found this question after experiencing a similar error on OpenSuse (13.2). So I figured I'd post my solution as well, in case other people find this via Google.

Although libportaudio2 is the package containing the libs, you need portaudio-devel as well to make the installation work.

时光磨忆 2024-11-12 19:38:24

此方法适用于 M1 Mac

安装M1 Mac 上的 PyAudio

这种方法对我来说成功了。

This method is working for M1 Macs

Install PyAudio on M1 Mac

This method has successfully worked for me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文