11

I am currently trying to install PyAudio on Python 3.7 but when I use the command "pip install pyaudio", an error message appears:

  "command 'cl.exe' failed: No such file or directory".

I have already tried to modify the PATH but it doesn't work. I thought maybe someone could help me?

cigien
  • 57,834
  • 11
  • 73
  • 112
Cyrielle Albert
  • 129
  • 1
  • 2
  • 7

9 Answers9

18

Download the wheel on this site https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio.

Choose PyAudio‑0.2.11‑cp37‑cp37m‑win32.whl if you use 32 bit, or PyAudio‑0.2.11‑cp37‑cp37m‑win_amd64.whl for 64 bit. Then go to your download folder:

cd <your_donwload_path>

Then, for 64 bit:

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

or for 32 bit:

pip install PyAudio‑0.2.11‑cp37‑cp37m‑win32.whl
Hiadore
  • 686
  • 3
  • 15
  • 1
    May you use 32 bit python? If then, you need to download 32 bit version of PyAudio. – Hiadore Oct 09 '19 at 01:35
  • It just gives me the error: "ERROR: PyAudio-0.2.11-cp38-cp38-win_amd64.whl is not a supported wheel on this platform." FYI - I am on a mac – Darrow Hartman May 16 '20 at 17:07
  • @DarrowHartman, it's just for windows. It's stated on the page title: Unofficial Windows Binaries for Python Extension Packages. – Hiadore May 18 '20 at 01:07
  • 1
    @Hiadore, I get this error: ```ERROR: PyAudio-0.2.11-cp37-cp37m-win32.whl is not a supported wheel on this platform.``` on windows after following your suggested steps. Any hints as to why this is happening? – Shrey Tripathi Jun 04 '20 at 12:00
  • My machine and python version 3.7 is 64 bit, but the 64 bit .whl file didn't work – Divyanshu Kushwaha Jun 23 '20 at 08:21
  • @ShreyTripathi and DivyanshuKushwaha, can you show me the error message? – Hiadore Jun 24 '20 at 09:57
  • 1
    It says `ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: 'C:\\Users\\User\\Desktop\\Python\\Python38\\Lib\\site-packages\\PyAudio-0.2.11-cp38-cp38-win_amd64.whl'` ((( –  Aug 23 '20 at 18:38
12

WINDOWS

  1. pip install pipwin
  2. pipwin install pyaudio

This will install pyaudio

Joljas Kerketta
  • 121
  • 1
  • 3
3

It is supported in Python 3.7. Even though not officially on standalone 3.7, Anaconda 2019.10 which uses 3.7 has it. So you have 2 options:

  1. You can conda install -c anaconda pyaudio, if you use Anaconda
  2. Or for standalone Python 3.7 you can:

2a) After installing the .whl, build portaudio.dll just following the instructions at http://portaudio.com/docs/v19-doxydocs/compile_windows.html. I used VS2019 and i worked. Note if you choose ASIO option you will need ASIO SDK from https://www.steinberg.net/en/company/developers.html

After that just put portaudio.dll anywhere in your system path or local directory and you can import pyaudio.

2b) If you don't want to build, simply steal portaudio.dll from Anaconda. It's in <Anaconda_root>/Library/bin

Community
  • 1
  • 1
David
  • 644
  • 5
  • 4
2

It's not compatible with 3.7 and as far as I have been able to find thus far there doesn't appear to be any work being put into making it compatible and I haven't found any sort of replacement, so unless you want to build the package yourself and make it compatible with 3.7 then it can't be used without downgrading your python install to 3.6, I did try Hiadore's answer and that does not work either with 3.7.

Zenshu
  • 29
  • 2
2

Simply Download wheel file from https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio , get the file for your Python version and bitness. Change the directory location to the download file location or copy downloaded file to the working location.

Install it with pip install filename.whl

sanyassh
  • 8,100
  • 13
  • 36
  • 70
1

Extract to https://people.csail.mit.edu/hubert/pyaudio/

In Windows:

Install using pip:

python -m pip install pyaudio 

Currently, there are wheels compatible with the official distributions of Python 2.7, 3.4, 3.5, and 3.6.

Apparently there is no version of that library for Python 3.7, so I'd try downgrading the Python version.

If you continue to have problems with the error of .exe, in this answer https://stackoverflow.com/a/41724634/7290770 they solve it.

laurajaime
  • 379
  • 1
  • 3
  • 14
1

pyaudio is not supported with python 3.7.

Downgrade your version to python 3.6.8.

then try installing pyaudio using the command: pip install pyaudio

A_jain2310
  • 39
  • 1
  • 5
1
  1. Install python 3.6
  2. Install PyCharm
  3. While in PyCharm click File
  4. Click on settings
  5. Click Project Interpreter
  6. Click on the Gear icon ,You should see Add,Show All Click on Add
  7. Next Click System Interpreter
  8. Click the dropdown if you installed python 3.6 you should see it there
  9. Click it Hit ok and install PyAudio this should fix it..
patrick.elmquist
  • 2,113
  • 2
  • 21
  • 35
Lifeofkaz
  • 11
  • 1
1

Use this link to download .whl file according to the python version it supports. For Python -3.7 use PyAudio‑0.2.11‑cp37‑cp37m‑win32.whl

Go and run this command on the Windows command prompt:

pip install PyAudio-0.2.11-cp37-cp37m-win32.whl
WhipStreak23
  • 79
  • 2
  • 9
Shristi Bisht
  • 101
  • 1
  • 5