简体   繁体   中英

Python PyAudio install

My PC dont want to 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:\users\lemcr\appdata\local\programs\python\python38\python.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('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file , '"'"'exec'"'"'))' install --record 'C:\Users\LEMCr\AppData\Local\Temp\pip-record-l8j78jvs\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\lemcr\appdata\local\programs\python\python38\Include\PyAudio' cwd: C:\Users\LEMCr\AppData\Local\Temp\pip-install-a02e_7yr\pyaudio_110e15c18e6044c99a162c26dbed278b
Complete output (17 lines): running install running build running build_py creating build creating build\lib.win-amd64-3.8 copying src\pyaudio.py -> build\lib.win-amd64-3.8 running build_ext building '_portaudio' extension creating build\temp.win-amd64-3.8 creating build\temp.win-amd64-3.8\Release creating build\temp.win-amd64-3.8\Release\src C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DMS_WIN64=1 -Ic:\users\lemcr\appdata\local\programs\python\python38\include -Ic:\users\lemcr\appdata\local\programs\python\python38\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows K its\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcsrc/_portaudiomodule.c /Fobuild\temp.win-amd64-3.8\Release\src/_portaudiomodule.obj _portaudiomodule.c c:\users\lemcr\appdata\local\programs\python\python38\include\pyconfig.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\x 64\cl.exe' failed with exit status 2 ---------------------------------------- ERROR: Command errored out with exit status 1: 'c:\users\lemcr\appdata\local\programs\python\python38\python.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('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file , '"'"'exec'"'"'))' install --record 'C:\Users\LEMCr\AppData\Local\Temp\pip-record-l8j78jvs\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\lemcr\appdata\local\programs\python\python38\Include\PyAudio' Check the logs for full command output.

Your problem persists because maybe the developer of the package PyAudio hasn't updated the package. In addition to that I suggest you install some other package which possess similar operation.

For eg you can install pydub or simpleaudio . For installing:

python -m pip install pydub/simpleaudio

or

pip3 install pydub/simpleaudio 

Use a precompiled wheel for windows. I recommend this site . Pyaudio wheels can be found here . Download the one corresponding to your python version and install it with:

py -m pip install name.whl

Obviously from the same directory or replace name.whl with the full path to the wheel. I also recommend you first upgrade pip and setuptools with:

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

After using pyaudio myself, I recommend using sounddevice instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM