无法安装Pyaudi

2024-10-02 22:32:44 发布

您现在位置:Python中文网/ 问答频道 /正文

在我的python3.7中无法安装Pyaudio..甚至尝试安装visualc++。在

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

Tags: installpippybuildlocalsetuprecordusers
2条回答

不能安装Pyaudio的原因是python版本,支持Pyaudio的python的最后一个版本是python3.6 所以必须安装python3.6、3.5、3.4或python2.7。 安装Python3.6后,使用此链接并下载pyaudio.whl根据你的操作系统。 然后使用以下命令进行安装:

pip install <package_name>.whl

要使用conda安装最新版本的pyaudio:

source activate -your environment name-
pip install pyaudio

如果遇到PortAudio开发包错误,请使用

^{pr2}$

相关问题 更多 >