当我制作虚拟助手时,代码编辑器说需要一个名为PyAudio的模块。所以,我打开终端并输入... pip install PyAudio ...
它告诉我:
Collecting PyAudio
Using cached PyAudio-0.2.11.tar.gz (37 kB)
Building wheels for collected packages: PyAudio
Building wheel for PyAudio (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\agniva roy\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Agniva Roy\\AppData\\Local\\Temp\\pip-install-xo7mfu1k\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\Agniva Roy\\AppData\\Local\\Temp\\pip-install-xo7mfu1k\\pyaudio\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Agniva Roy\AppData\Local\Temp\pip-wheel-uf1qmafg'
cwd: C:\Users\Agniva Roy\AppData\Local\Temp\pip-install-xo7mfu1k\pyaudio\
Complete output (9 lines):
running bdist_wheel
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
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Failed building wheel for PyAudio
Running setup.py clean for PyAudio
Failed to build PyAudio
DEPRECATION: Could not build wheels for PyAudio which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368.
Installing collected packages: PyAudio
Running setup.py install for PyAudio ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\agniva roy\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Agniva Roy\\AppData\\Local\\Temp\\pip-install-xo7mfu1k\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\Agniva Roy\\AppData\\Local\\Temp\\pip-install-xo7mfu1k\\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\Agniva Roy\AppData\Local\Temp\pip-record-0q8d47m5\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\agniva roy\Include\PyAudio'
cwd: C:\Users\Agniva Roy\AppData\Local\Temp\pip-install-xo7mfu1k\pyaudio\
Complete output (9 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
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\agniva roy\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Agniva Roy\\AppData\\Local\\Temp\\pip-install-xo7mfu1k\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\Agniva Roy\\AppData\\Local\\Temp\\pip-install-xo7mfu1k\\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\Agniva Roy\AppData\Local\Temp\pip-record-0q8d47m5\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\agniva roy\Include\PyAudio' Check the logs for full command output.
请帮帮我。我什至尝试安装预构建的pyaudio
车轮,但是它也不起作用。
答案 0 :(得分:0)
您已经在说明中找到答案
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
Download Microsoft c++ dependencies from Microsoft website
并重做构建