简体   繁体   中英

Can't pip install pyAudio in conda environment (MAC)

I am using a conda enviroment on mac and I want to install pyAudio. I tried to follow the suggestion in many threads to run

brew install portaudio

r

pip install --global-option='build_ext' --global-option='-I/usr/local/include' --global-option='-L/usr/local/lib' pyaudio

But it still didn't work from within the conda enviroment. However, running

pip install --global-option='build_ext' --global-option='-I/usr/local/include' --global-option='-L/usr/local/lib' pyaudio 

worked outside of the conda enviroemtn (in the "base" enviroemtn").

What might be the reason? How can I install pyAudio inside the conda enviroment?

Try conda install -c anaconda pyaudio

Source: https://anaconda.org/anaconda/pyaudio

portaudio is not a python package. The easiest solution would be use the pyaudio conda package from this place https://anaconda.org/anaconda/pyaudio

You can try the following commands to install pyaudio inside conda (after activating your conda environment).

conda config --add channels conda-forge

conda install pyaudio

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 conda for example in my case:

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

link source here

Or try this if you already download whl

conda install -c anaconda pyaudio

link source here

From the anaconda.org they recommend this pyaudio 0.27:

conda install -c mutirri pyaudio 

otherwise for pyaudio 0.2.11 this one:

conda install -c anaconda pyaudio

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