收到“错误:需要Microsoft Visual C ++ 14.0".在安装PyAudio时 [英] Getting "error: Microsoft Visual C++ 14.0 is required." when installing PyAudio
问题描述
C:\Users\gabri\OneDrive\Desktop>pip3 install pyaudio
Collecting pyaudio
Using cached https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\gabri\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\gabri\\AppData\\Local\\Temp\\pip-install-r9cgblze\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\gabri\\AppData\\Local\\Temp\\pip-install-r9cgblze\\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\gabri\AppData\Local\Temp\pip-record-032v86d_\install-record.txt' --single-version-externally-managed --compile --user --prefix=
cwd: C:\Users\gabri\AppData\Local\Temp\pip-install-r9cgblze\pyaudio\
Complete output (9 lines):
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
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\gabri\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\gabri\\AppData\\Local\\Temp\\pip-install-r9cgblze\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\gabri\\AppData\\Local\\Temp\\pip-install-r9cgblze\\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\gabri\AppData\Local\Temp\pip-record-032v86d_\install-record.txt' --single-version-externally-managed --compile --user --prefix= Check the logs for full command output.
我的python版本:3.7.4和pip已升级.
My python version: 3.7.4 and pip is upgraded.
我已经尝试过"python3.7 -m pip install PyAudio",但是它仍然无法正常工作.
I have already tried "python3.7 -m pip install PyAudio", but it still did not work.
我也尝试从.whl安装它,但是当我运行命令时,出现以下消息:
I have tried installing it from a .whl too, but when I run the command, the following message appears:
错误:此平台不支持PyAudio-0.2.11-cp34-cp34m-win32.whl."
ERROR: PyAudio-0.2.11-cp34-cp34m-win32.whl is not a supported wheel on this platform."
我尝试使用32位和64位.
I tried with 32 and 64 bit.
推荐答案
当前,有一些轮子与 Python 2.7、3.4、3.5和3.6的官方发行版兼容.
显然,该库没有适用于Python 3.7的版本,因此,我将尝试降级Python版本.
Apparently, there is no version of that library for Python 3.7, so I'd try downgrading the Python version.
在此网站上下载轮子: https://www.lfd. uci.edu/~gohlke/pythonlibs/#pyaudio .
Download the wheel on this site: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio.
选择:
- PyAudio‑0.2.11‑cp37‑cp37m‑win32.whl(如果使用32位)
- PyAudio‑0.2.11‑cp37‑cp37m‑win_amd64.whl(64位)
然后转到您的下载文件夹:
Then go to your download folder:
cd <your_donwload_path>
pip install PyAudio‑0.2.11‑cp37‑cp37m‑win_amd64.whl
这篇关于收到“错误:需要Microsoft Visual C ++ 14.0".在安装PyAudio时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!