简体   繁体   中英

Can't Install Pyaudio

Can't install Pyaudio in my python 3.7..even tried installing 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

The reason that you cant install Pyaudio is your python version, the last version of python that support Pyaudio is python 3.6 So you have to install python 3.6 or 3.5 or 3.4 or python 2.7. after installing python 3.6 use this link and download pyaudio.whl according to your os. then use this command to install it:

pip install <package_name>.whl

To install the latest version of pyaudio using conda:

source activate -your environment name-
pip install pyaudio

If you encounter PortAudio development package error, install it with

sudo apt-get install portaudio19-dev

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