3

I've been trying to install PyAudio for a speechrecognition project but for everything I've tried nothing has worked. I tried to install with the latest version of python (3.7) only to noobishly find out that pyaudio isnt compatible with that yet and now im trying with 3.4.

However, whenever I run 'pip install PyAudio' I get an error message saying 'error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat).' I have Microsoft Visual C++ 10.0 installed but it just doesn't work.

I'm at my wits end here please help.

(Running Windows 8.1 btw)

  • Possible duplicate of [error: Unable to find vcvarsall.bat](https://stackoverflow.com/questions/2817869/error-unable-to-find-vcvarsall-bat) – Iguananaut Jul 07 '18 at 20:34
  • Make sure the `pip` you're running is actually the `pip` for your Python 3 install. To be sure, better to run `python3.4 -m pip install ...`. Then make sure to see https://stackoverflow.com/questions/2817869/error-unable-to-find-vcvarsall-bat That said, it does appear that PyAudio has pre-compiled wheels for up to Python 3.6 on Windows so I'm not sure why you wouldn't be getting those: https://pypi.org/project/PyAudio/#files – Iguananaut Jul 07 '18 at 20:37
  • What program do i run 'python3.4 -m pip install' on? also the other question doesn't really answer anything as I've tried installing multiple different versions of visual studio. Also how do i run the setup.py from the tar.gz file from that link? I'm pretty new to pip and modules and need some help D: – Steve Mustache Jul 08 '18 at 14:15
  • What do you mean by "What program do i run 'python3.4 -m pip install' on?" Any command line... – Iguananaut Jul 09 '18 at 08:36
  • I forgot that on Windows Python doesn't normally install the `pythonX.Y` aliases. What I mean is just make sure you are running pip with the correct Python interpreter. When I ran `C:\Python34\python -m pip install pyaudio` it simply installed the pre-built wheel. – Iguananaut Jul 09 '18 at 08:37
  • Iguananaut I have learnt a bit more about command lines and pip and I ran python -m pip install pyaudio but it still just says unable to find vcvarsall.bat :/ – Steve Mustache Aug 06 '18 at 15:09
  • I don't know what to tell you. It sounds like some kind of subtle local configuration issue of the sort that would require hands-on digging around. See if you have a local expert who can help you. It's strange that it wouldn't just be installing the pre-build wheels in the first place. – Iguananaut Aug 08 '18 at 12:04
  • ok thanks. i might just have to give up on pyaudio – Steve Mustache Aug 09 '18 at 11:14
  • I mean, I don't think you should have to do that. Like, I just installed it fine. I think you just need to find someone who can walk through figuring out what's wrong with your system in real time. We could sit here going back an forth and i could ask a million questions but it would take forever. – Iguananaut Aug 09 '18 at 11:49
  • Another thing you could do is just go to https://pypi.org/project/PyAudio/#files, download the appropriate wheel file manually, and install it with `python -m pip install ` – Iguananaut Aug 09 '18 at 11:50
  • I downloaded the .whl file and ran the pip install command but it came out with the error 'PyAudio-0.2.11-cp34-cp34m-win_amd64.whl is not a supported wheel on this platform.' :( – Steve Mustache Aug 12 '18 at 12:33
  • Is it the 64-bit version of Python? – Iguananaut Aug 12 '18 at 20:06
  • yeah i have Python 3.4 64-bit installed – Steve Mustache Aug 13 '18 at 13:05
  • SOLVED! Finally! I was working on a different project today and had to install a different version of python to do it ( Python 3.6.5rc1 https://www.python.org/downloads/release/python-365rc1/ ) And while I was installing the modules for this project I thought I might as well give pyaudio another shot and it installed perfectly this time! Thank you for all your help Iguananaut! – Steve Mustache Aug 13 '18 at 15:34

4 Answers4

2

A good site to know about is Christoph Gohlke's page "Python Extension Packages for Windows" at https://www.lfd.uci.edu/~gohlke/pythonlibs/.

MRAB
  • 20,356
  • 6
  • 40
  • 33
1

I ended up solving my own problem by downloading a different version of python, the one that worked for me was Python 3.6.5rc1 (but any 3.6 version seems to work) (Found here: https://www.python.org/downloads/release/python-365rc1/ ) I don't know the full details of why this worked as I'm not the best at this kind of thing yet but it worked when I retried python -m pip install pyaudio(this installed pyaudio successfully)

  • FWIW 3.6.5.rc1 is a *release candidate* and not a final release. There's no reason it would work for this purpose over any other Python 3.6.x release because the ABI would not have changed between versions, nor would the platform specifiers in the wheel filenames... I suspect you just have too many Pythons on your system and are getting confused about which is which. – Iguananaut Aug 14 '18 at 16:51
  • are you saying that im talking about the wrong version of python? I have 2.7, 3.4 (the problem version) and now this release candidate – Steve Mustache Aug 14 '18 at 20:39
  • I'm just saying, it's sort of hard to say what problem you were having before (I was able to install PyAudio on Python 3.4 on Windows just fine). But if Python 3.6 works for you that's great. There's no real reason to use 3.4 which is quite old anyways. I'm just saying there's no reason to use a release candidate build. You might as well just use 3.6.4 (it seems PyAudio doesn't have a binary release for Python 3.7 yet, but it just came out a few weeks ago). I'm not saying it's "wrong", just that there's no reason to use a release candidate – Iguananaut Aug 15 '18 at 10:06
0

First upgrade pip to pi3 using following command:

pip3 install --upgrade setuptools pip

and then try with

pip3 install pyaudio

It will install but old versions PyAudio-0.2.11.tar.gz, PyAudio-0.2.11-cp36-cp36m-win_amd64.whl, PyAudio-0.2.11-cp36-cp36m-win_amd64.whl, not support to python 3.7 and after it

Alicia
  • 1,152
  • 1
  • 23
  • 41
0

Download file from https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio , get the file for your Python version and bitness. Paste the file of interest in location "C:\Users\YOUR_USER_NAME"

Install it with pip install filename.whl

Employee
  • 3,109
  • 5
  • 31
  • 50
Strike
  • 164
  • 1
  • 13