简体   繁体   English

无法 pip 在 conda 环境(MAC)中安装 pyAudio

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

I am using a conda enviroment on mac and I want to install pyAudio.我在 mac 上使用 conda 环境,我想安装 pyAudio。 I tried to follow the suggestion in many threads to run我试图在许多线程中遵循建议来运行

brew install portaudio

r 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.但它仍然无法conda 环境中工作。 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").在 conda enviroemtn 之外工作(在“基础”enviroemtn 中)。

What might be the reason?可能是什么原因? How can I install pyAudio inside the conda enviroment?如何在 conda 环境中安装 pyAudio?

Try conda install -c anaconda pyaudio尝试conda install -c anaconda pyaudio

Source: https://anaconda.org/anaconda/pyaudio资料来源: https://anaconda.org/anaconda/pyaudio

portaudio is not a python package. portaudio不是 python package。 The easiest solution would be use the pyaudio conda package from this place https://anaconda.org/anaconda/pyaudio最简单的解决方案是从这个地方使用pyaudio conda package https://anaconda.org/anaconda/pyaudio

You can try the following commands to install pyaudio inside conda (after activating your conda environment).您可以尝试以下命令在 conda 中安装 pyaudio(激活您的 conda 环境后)。

conda config --add channels conda-forge

conda install pyaudio

find your Python version by python --version mine is 3.7.3 for example通过 python 找到您的 Python 版本——例如,我的版本是 3.7.3

the easiest way to check either you have 64 or 32 Python just open it in the terminal:检查您有 64 个或 32 个 Python 的最简单方法只需在终端中打开它:

find the appropriate.whl file from here , for example mine is这里找到适当的.whl 文件,例如我的是

PyAudio‑0.2.11‑cp37‑cp37m‑win_amd64.whl, and download it. PyAudio‑0.2.11‑cp37‑cp37m‑win_amd64.whl,然后下载。

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: go 到下载它的文件夹,例如 cd C:\Users\foobar\Downloads 使用 conda 安装 .whl 文件,例如在我的情况下:

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

link source here链接源在这里

Or try this if you already download whl或者如果你已经下载了 whl 试试这个

conda install -c anaconda pyaudio

link source here链接源在这里

From the anaconda.org they recommend this pyaudio 0.27:从 anaconda.org 他们推荐这个 pyaudio 0.27:

conda install -c mutirri pyaudio 

otherwise for pyaudio 0.2.11 this one:否则对于 pyaudio 0.2.11 这个:

conda install -c anaconda pyaudio

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM