[python] I can't install pyaudio on Windows? How to solve "error: Microsoft Visual C++ 14.0 is required."?

I have a Windows 10 PC and I want to install pyaudio to use it with my chatbot, powered by chatterbot.

I tried 2 different ways to install pyaudio.

The first way is doing this on the command prompt:

python -m pip install PyAudio

This is the result:

   C:\Users\Waaberi>python -m pip 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
    Complete output from command C:\Users\Waaberi\AppData\Local\Programs\Python\Python37-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Waaberi\\AppData\\Local\\Temp\\pip-install-e5le61j0\\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\Waaberi\AppData\Local\Temp\pip-record-adj3zivl\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.7
    copying src\pyaudio.py -> build\lib.win32-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

    ----------------------------------------
Command "C:\Users\Waaberi\AppData\Local\Programs\Python\Python37-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Waaberi\\AppData\\Local\\Temp\\pip-install-e5le61j0\\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\Waaberi\AppData\Local\Temp\pip-record-adj3zivl\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Waaberi\AppData\Local\Temp\pip-install-e5le61j0\PyAudio\

The second way is entering this command:

python pip install python-pyaudio

and it does nothing.

This question is related to python python-3.x windows pyaudio

The answer is


The answer by Agalin is already great and I just want to explain it in a step by step format for a novice like myself:

  • find your Python version by python --version mine is 3.7.3 for example
  • the easiest way to check either you have 64 or 32 Python just open it in the terminal:

  • find the appropriate .whl file from here, for example mine is PyAudio-0.2.11-cp37-cp37m-win_amd64.whl, and download it.
  • go to the folder where it is downloaded for example cd C:\Users\foobar\Downloads
  • install the .whl file with pip for example in my case:
pip install PyAudio-0.2.11-cp37-cp37m-win_amd64.whl

First run your IDE or CMD as Administrator and run the following:

pip install pipwin
pipwin install pyaudio

There is no wheel (prebuilt package) for Python 3.7 on Windows (there is one for Python 2.7 and 3.4 up to 3.6) so you need to prepare build environment on your PC to use this package. Easier would be finding the wheel for 3.7 as some packages are quite hard to build on Windows.

Christoph Gohlke (University of California) hosts Windows wheels for most popular packages for nearly all modern Python versions, including latest PyAudio. You can find it here: https://www.lfd.uci.edu/~gohlke/pythonlibs/ (download can be quite slow). After download, just type pip install <downloaded file here>.

There is no difference between python -m pip install, and pip install as long as you're using default installation settings and single python installation. python pip actually tries to run file pip in the current directory.

Edit. See the pipwin comment for automated way of using Mr Goblke's libs . Note that I've not used it myself and I'm not sure about selecting different package flavors like vanilla and mkl versions of numpy.


Use Conda instead of pip. It works perfectly

conda install PyAudio

you may need to try

pip install --upgrade setuptools

you may also need to install Visual Studio 2015, and remember to choose to install Visual C++ 14.0 https://visualstudio.microsoft.com/visual-cpp-build-tools/


If you have anaconda install than you just need to use command: conda install PyAudio.

In order to execute this command you must set thePYTHONPATH environment variable in anaconda.


You should install python 3.6 version because python 3.7 version doesn't support pyaudio 1 step : Then download the .whl file
according to your python version and the configuration of your machine in your python folder which is newly installed. For me it is python 3.6 and 64 bit machine. Download the file from here (https://www.lfd.uci.edu/~gohlke/pythonlibs/) 2 step : run your cmd and type " pip install your downloaded file name here "


The problem is pyaudio does not have wheels for python 3.7 just try some lower version like 3.6 then install pyaudio

It works


You should just install python 3.6. I tried it and it worked. Just install that version of python and just do the normal download process (pip install pyaudio).


I have got the same error as :

error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/

As, said by @Agaline, i download the outside wheel from this Christoph Gohlke.

If your is Python 3.7 then try to PyAudio-0.2.11-cp37-cp37m-win_amd64.whl and use command as, go to the download directroy and:

pip install PyAudio-0.2.11-cp37-cp37m-win_amd64.whl and it works.


Seems PyAudio is supported by Python 2.7, 3.4, 3.5, and 3.6. Refer https://people.csail.mit.edu/hubert/pyaudio/

Please suggest if there is any alternate way to install PyAudio on Python 3.8.2


If you are using Python 3.7.3 and Windows 10 64-bit machine then try the following command. Go to the download folder and Install following command:

pip install PyAudio-0.2.11-cp37-cp37m-win_amd64.whl

and it should work.


I had the same issue but solved it by using Ubuntu.

  1. python -m pip install pyaudio
  2. Install sudo, apt-get and then install homebrew &/ linuxbrew on your linux subsystem using Ubuntu.
  3. The latest version supports ubuntu.
  4. brew install portaudio
  5. Make sure you have python/python3 installed on the terminal
  6. Make sure the current location is added as path in your virtual computer's path in environment Variable.
  7. brew link portaudio

Questions with python tag:

programming a servo thru a barometer Is there a way to view two blocks of code from the same file simultaneously in Sublime Text? python variable NameError Why my regexp for hyphenated words doesn't work? Comparing a variable with a string python not working when redirecting from bash script is it possible to add colors to python output? Get Public URL for File - Google Cloud Storage - App Engine (Python) Real time face detection OpenCV, Python xlrd.biffh.XLRDError: Excel xlsx file; not supported Could not load dynamic library 'cudart64_101.dll' on tensorflow CPU-only installation Upgrade to python 3.8 using conda Unable to allocate array with shape and data type How to fix error "ERROR: Command errored out with exit status 1: python." when trying to install django-heroku using pip How to prevent Google Colab from disconnecting? "UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure." when plotting figure with pyplot on Pycharm How to fix 'Object arrays cannot be loaded when allow_pickle=False' for imdb.load_data() function? "E: Unable to locate package python-pip" on Ubuntu 18.04 Tensorflow 2.0 - AttributeError: module 'tensorflow' has no attribute 'Session' Jupyter Notebook not saving: '_xsrf' argument missing from post How to Install pip for python 3.7 on Ubuntu 18? Python: 'ModuleNotFoundError' when trying to import module from imported package OpenCV TypeError: Expected cv::UMat for argument 'src' - What is this? Requests (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.") Error in PyCharm requesting website How to setup virtual environment for Python in VS Code? Pylint "unresolved import" error in Visual Studio Code Pandas Merging 101 Numpy, multiply array with scalar What is the meaning of "Failed building wheel for X" in pip install? Selenium: WebDriverException:Chrome failed to start: crashed as google-chrome is no longer running so ChromeDriver is assuming that Chrome has crashed Could not install packages due to an EnvironmentError: [Errno 13] OpenCV !_src.empty() in function 'cvtColor' error ConvergenceWarning: Liblinear failed to converge, increase the number of iterations How to downgrade python from 3.7 to 3.6 I can't install pyaudio on Windows? How to solve "error: Microsoft Visual C++ 14.0 is required."? Iterating over arrays in Python 3 How do I install opencv using pip? How do I install Python packages in Google's Colab? How do I use TensorFlow GPU? How to upgrade Python version to 3.7? How to resolve TypeError: can only concatenate str (not "int") to str How can I install a previous version of Python 3 in macOS using homebrew? Flask at first run: Do not use the development server in a production environment TypeError: only integer scalar arrays can be converted to a scalar index with 1D numpy indices array What is the difference between Jupyter Notebook and JupyterLab? Pytesseract : "TesseractNotFound Error: tesseract is not installed or it's not in your path", how do I fix this? Could not install packages due to a "Environment error :[error 13]: permission denied : 'usr/local/bin/f2py'" How do I resolve a TesseractNotFoundError? Trying to merge 2 dataframes but get ValueError Authentication plugin 'caching_sha2_password' is not supported Python Pandas User Warning: Sorting because non-concatenation axis is not aligned

Questions with python-3.x tag:

Could not load dynamic library 'cudart64_101.dll' on tensorflow CPU-only installation Replace specific text with a redacted version using Python Upgrade to python 3.8 using conda "Permission Denied" trying to run Python on Windows 10 Python: 'ModuleNotFoundError' when trying to import module from imported package What is the meaning of "Failed building wheel for X" in pip install? How to downgrade python from 3.7 to 3.6 I can't install pyaudio on Windows? How to solve "error: Microsoft Visual C++ 14.0 is required."? Iterating over arrays in Python 3 How to upgrade Python version to 3.7? TypeError: only integer scalar arrays can be converted to a scalar index with 1D numpy indices array How do I resolve a TesseractNotFoundError? Could not find a version that satisfies the requirement tensorflow Not able to pip install pickle in python 3.6 json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 190) installing urllib in Python3.6 pip install returning invalid syntax Unable to import path from django.urls Display all dataframe columns in a Jupyter Python Notebook How to make Firefox headless programmatically in Selenium with Python? How to import cv2 in python3? Pipenv: Command Not Found Error in Python script "Expected 2D array, got 1D array instead:"? Fixed digits after decimal with f-strings How do I upgrade the Python installation in Windows 10? Pip error: Microsoft Visual C++ 14.0 is required Python error message io.UnsupportedOperation: not readable Anaconda Installed but Cannot Launch Navigator Conda command is not recognized on Windows 10 TypeError: can't pickle _thread.lock objects How do you fix the "element not interactable" exception? How to print a specific row of a pandas DataFrame? Relative imports - ModuleNotFoundError: No module named x SyntaxError: unexpected EOF while parsing ImportError: No module named 'django.core.urlresolvers' Why Python 3.6.1 throws AttributeError: module 'enum' has no attribute 'IntFlag'? What is the purpose of "pip install --user ..."? Add Legend to Seaborn point plot How to install pip for Python 3.6 on Ubuntu 16.10? Python sockets error TypeError: a bytes-like object is required, not 'str' with send function WinError 2 The system cannot find the file specified (Python) Python 3.6 install win32api? error UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte Python 3 - ValueError: not enough values to unpack (expected 3, got 2) matplotlib: plot multiple columns of pandas data frame on the bar chart Unable to set default python version to python3 in ubuntu TypeError: '<=' not supported between instances of 'str' and 'int' pandas: merge (join) two data frames on multiple columns Replacing a character from a certain index Scrolling to element using webdriver?

Questions with windows tag:

"Permission Denied" trying to run Python on Windows 10 A fatal error occurred while creating a TLS client credential. The internal error state is 10013 How to install OpenJDK 11 on Windows? I can't install pyaudio on Windows? How to solve "error: Microsoft Visual C++ 14.0 is required."? git clone: Authentication failed for <URL> How to avoid the "Windows Defender SmartScreen prevented an unrecognized app from starting warning" XCOPY: Overwrite all without prompt in BATCH Laravel 5 show ErrorException file_put_contents failed to open stream: No such file or directory how to open Jupyter notebook in chrome on windows Tensorflow import error: No module named 'tensorflow' git clone error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054 bash: npm: command not found? Anaconda Installed but Cannot Launch Navigator AttributeError: module 'cv2.cv2' has no attribute 'createLBPHFaceRecognizer' How to install pandas from pip on windows cmd? 'ls' in CMD on Windows is not recognized Copy Files from Windows to the Ubuntu Subsystem Tensorflow r1.0 : could not a find a version that satisfies the requirement tensorflow Kill tomcat service running on any port, Windows python pip on Windows - command 'cl.exe' failed How to install pip3 on Windows? Mount current directory as a volume in Docker on Windows 10 Specifying Font and Size in HTML table Why Local Users and Groups is missing in Computer Management on Windows 10 Home? Command to run a .bat file How do I force Robocopy to overwrite files? Windows- Pyinstaller Error "failed to execute script " When App Clicked How to completely uninstall Android Studio from windows(v10)? Docker for Windows error: "Hardware assisted virtualization and data execution protection must be enabled in the BIOS" How do I kill the process currently using a port on localhost in Windows? Error : getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443 How to add a custom CA Root certificate to the CA Store used by pip in Windows? How to reset the use/password of jenkins on windows? npm ERR! Error: EPERM: operation not permitted, rename CMD (command prompt) can't go to the desktop Xampp-mysql - "Table doesn't exist in engine" #1932 Change drive in git bash for windows "OverflowError: Python int too large to convert to C long" on windows but not mac Visual studio code terminal, how to run a command with administrator rights? ImportError: cannot import name NUMPY_MKL Pip - Fatal error in launcher: Unable to create process using '"' Installing tensorflow with anaconda in windows Where does Anaconda Python install on Windows? PermissionError: [Errno 13] Permission denied How to restart a windows service using Task Scheduler How to install xgboost in Anaconda Python (Windows platform)? NPM stuck giving the same error EISDIR: Illegal operation on a directory, read at error (native) Can't access 127.0.0.1 anaconda - path environment variable in windows Global npm install location on windows?

Questions with pyaudio tag:

I can't install pyaudio on Windows? How to solve "error: Microsoft Visual C++ 14.0 is required."?