我已经为python 3.7安装了带有PyAudio-0.2.11-cp37-cp37m-win_amd64.whl的pyaudio,但仍然收到错误AttributeError: Could not find PyAudio; check installation
,当我尝试使用pip时,安装了PyAudio-0.2.11-cp37-cp37m -win_amd64.whl,然后显示要求已经满足,然后我尝试使用以下命令并获取以下错误
(venv) C:\Users\Admin\PycharmProjects\data>pip install pyaudio
Collecting pyaudio
Using cached https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae36
54ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
Complete output from command C:\Users\Admin\PycharmProjects\data\venv\Scripts\python.exe -u -c "im
port setuptools, tokenize;__file__='C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-gp9h_yud\\pyau
dio\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close
();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Admin\AppData\Local\Temp\pip-recor
d-v_1obf23\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users
\Admin\PycharmProjects\data\venv\include\site\python3.7\pyaudio:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
copying src\pyaudio.py -> build\lib.win-amd64-3.7
running build_ext
building '_portaudio' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\src
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\bin\HostX
86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -DMS_WIN64=1 -IC:\Users\Admin\PycharmProjects\data\v
env\include -IC:\Users\Admin\AppData\Local\Programs\Python\Python37\include -IC:\Users\Admin\AppData\L
ocal\Programs\Python\Python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTool
s\VC\Tools\MSVC\14.25.28610\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\uc
rt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\W
indows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0
\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tcsrc/_portaudiomodu
le.c /Fobuild\temp.win-amd64-3.7\Release\src/_portaudiomodule.obj
_portaudiomodule.c
C:\Users\Admin\AppData\Local\Programs\Python\Python37\include\pyconfig.h(117): warning C4005: 'MS_
WIN64': macro redefinition
src/_portaudiomodule.c: note: see previous definition of 'MS_WIN64'
src/_portaudiomodule.c(29): fatal error C1083: Cannot open include file: 'portaudio.h': No such fi
le or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSV
C\\14.25.28610\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
Command "C:\Users\Admin\PycharmProjects\data\venv\Scripts\python.exe -u -c "import setuptools, tokeniz
e;__file__='C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-gp9h_yud\\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 C:\Users\Admin\AppData\Local\Temp\pip-record-v_1obf23\install-recor
d.txt --single-version-externally-managed --compile --install-headers C:\Users\Admin\PycharmProjects\d
ata\venv\include\site\python3.7\pyaudio" failed with error code 1 in C:\Users\Admin\AppData\Local\Temp
\pip-install-gp9h_yud\pyaudio\