python - 无法安装Pyaudio

标签 python python-3.x python-2.7

无法在我的 python 3.7 中安装 Pyaudio..甚至尝试安装 Visual C++。

pip install pyaudio
Collecting pyaudio
  Using cached https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz
Building wheels for collected packages: pyaudio
  Running setup.py bdist_wheel for pyaudio
  Complete output from command "c:\users\vicky kumar\appdata\local\programs\python\python37\python.exe" -c "import setuptools;__file__='C:\\Users\\VICKYK~1\\AppData\\Local\\Temp\\pip-build-5v23nswh\\pyaudio\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d C:\Users\VICKYK~1\AppData\Local\Temp\tmprsn0men8pip-wheel-:
  running bdist_wheel
  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": http://landinghub.visualstudio.com/visual-cpp-build-tools

  ----------------------------------------
  Failed building wheel for pyaudio
Failed to build pyaudio
Installing collected packages: pyaudio
  Running setup.py install for pyaudio
    Complete output from command "c:\users\vicky kumar\appdata\local\programs\python\python37\python.exe" -c "import setuptools, tokenize;__file__='C:\\Users\\VICKYK~1\\AppData\\Local\\Temp\\pip-build-5v23nswh\\pyaudio\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\VICKYK~1\AppData\Local\Temp\pip-m53gsf79-record\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    running build_ext
    building '_portaudio' extension
    error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

    ----------------------------------------
Command ""c:\users\vicky kumar\appdata\local\programs\python\python37\python.exe" -c "import setuptools, tokenize;__file__='C:\\Users\\VICKYK~1\\AppData\\Local\\Temp\\pip-build-5v23nswh\\pyaudio\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\VICKYK~1\AppData\Local\Temp\pip-m53gsf79-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\VICKYK~1\AppData\Local\Temp\pip-build-5v23nswh\pyaudio

最佳答案

无法安装Pyaudio的原因是你的python版本,支持Pyaudio的最后一个版本是python 3.6 所以你必须安装python 3.6或3.5或3.4或python 2.7。 安装 python 3.6 后,使用此链接并根据您的操作系统下载 pyaudio.whl。 然后使用这个命令来安装它:

pip install <package_name>.whl

关于python - 无法安装Pyaudio,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53921262/

相关文章:

python - 如何找到 Pypi 包的最新*兼容*版本?

python - 填充numpy数组中的相邻元素

python - python中如何区分 "a string"和 "a actual code"?

python - 如何检查来自 os.system 的错误代码?

Mysql更新时将varchar转换为年份

Python - pandas 写入 csv 文件时避免拆分字符串列

python - 迭代 float 列表

python - 如何用 BeautifulSoup 只抓取可见的网页文本?

Python密码程序

Python - 列表中每个项目后的换行符