Python PyAudio install



我的电脑不想安装PyAudio

pip install PyAudio
Collecting PyAudio
Using cached PyAudio-0.2.11.tar.gz (37 kB)
Using legacy 'setup.py install' for PyAudio, since package 'wheel' is not installed.
Installing collected packages: PyAudio
Running setup.py install for PyAudio ... error
ERROR: Command errored out with exit status 1:
command: 'c:userslemcrappdatalocalprogramspythonpython38python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\LEMCr\AppData\Local\Temp\pip-install-a02e_7yr\pyaudio_110e15c18e6044c99a162c26dbed278b\setup.py'"'"'; __file__='"'"'C:\Users\LEMCr\AppData\Local\Temp\pip-install-a02e_7yr\pyaudio_110e15c18e6044c99a162c26dbed278b\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersLEMCrAppDataLocalTemppip-record-l8j78jvsinstall-record.txt' --single-version-externally-managed --compile --install-headers 'c:userslemcrappdatalocalprogramspythonpython38IncludePyAudio'
cwd: C:UsersLEMCrAppDataLocalTemppip-install-a02e_7yrpyaudio_110e15c18e6044c99a162c26dbed278b
Complete output (17 lines):
running install
running build
running build_py
creating build
creating buildlib.win-amd64-3.8
copying srcpyaudio.py -> buildlib.win-amd64-3.8
running build_ext
building '_portaudio' extension
creating buildtemp.win-amd64-3.8
creating buildtemp.win-amd64-3.8Release
creating buildtemp.win-amd64-3.8Releasesrc
C:Program Files (x86)Microsoft Visual Studio2019CommunityVCToolsMSVC14.28.29910binHostX86x64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMS_WIN64=1 -Ic:userslemcrappdatalocalprogramspythonpython38include -Ic:userslemcrappdatalocalprogramspythonpython38include "-IC:Program Files (x86)Microsoft Visual Studio2019CommunityVCToolsMSVC14.28.29910ATLMFCinclude" "-IC:Program Files (x86)Microsoft Visual Studio2019CommunityVCToolsMSVC14.28.29910include" "-IC:Program Files (x86)Windows KitsNETFXSDK4.8includeum" "-IC:Program Files (x86)Windows Kits10include10.0.19041.0ucrt" "-IC:Program Files (x86)Windows Kits10include10.0.19041.0shared" "-IC:Program Files (x86)Windows Kits10include10.0.19041.0um" "-IC:Program Files (x86)Windows Kits10include10.0.19041.0winrt" "-IC:Program Files (x86)Windows Kits10include10.0.19041.0cppwinrt" /Tcsrc/_portaudiomodule.c /Fobuildtemp.win-amd64-3.8Releasesrc/_portaudiomodule.obj
_portaudiomodule.c
c:userslemcrappdatalocalprogramspythonpython38includepyconfig.h(117): warning C4005: "MS_WIN64": Makro-Neudefinition
src/_portaudiomodule.c: note: Siehe vorherige Definition von "MS_WIN64"
src/_portaudiomodule.c(29): fatal error C1083: Datei (Include) kann nicht ge”ffnet werden: "portaudio.h": No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:userslemcrappdatalocalprogramspythonpython38python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\LEMCr\AppData\Local\Temp\pip-install-a02e_7yr\pyaudio_110e15c18e6044c99a162c26dbed278b\setup.py'"'"'; __file__='"'"'C:\Users\LEMCr\AppData\Local\Temp\pip-install-a02e_7yr\pyaudio_110e15c18e6044c99a162c26dbed278b\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersLEMCrAppDataLocalTemppip-record-l8j78jvsinstall-record.txt' --single-version-externally-managed --compile --install-headers 'c:userslemcrappdatalocalprogramspythonpython38IncludePyAudio' Check the logs for full command output.

您的问题仍然存在,因为PyAudio软件包的开发人员可能没有更新软件包。除此之外,我建议您安装其他具有类似操作的软件包。

例如,您可以安装pydubsimpleaudio。用于安装:

python -m pip install pydub/simpleaudio

pip3 install pydub/simpleaudio 

为windows使用预编译的轮子。我推荐这个网站。Pyaudio轮子可以在这里找到。下载与您的python版本相对应的版本,并使用进行安装

py -m pip install name.whl

显然来自同一目录,或者用指向轮子的完整路径替换name.whl。我还建议您首先升级pip和设置工具:

py -m pip install --upgrade pip
py -m pip install --upgrade setuptools

在我自己使用了pyaudio之后,我建议使用sounddevice

最新更新