pyaudio installation on mac (python 3)

后端 未结 4 1885
清酒与你
清酒与你 2020-12-14 00:46

I first tried:

pip install pyaudio

but I was told that

-bash: pip: command not found

Then I tried:

相关标签:
4条回答
  • 2020-12-14 01:28

    Steps: I assume you are using a mac osx

    download homebrew by pasting this code at any terminal point /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

    After installing homebrew, install portaudio: brew install portaudio

    Finally install pyaudio using pip pip install pyaudio

    0 讨论(0)
  • 2020-12-14 01:30

    I'm assuming you are on a Mac. This is a simple issue to fix.

    First install Xcode. Then restart your computer. Afterwards run the commands in sequence,

    xcode-select --install
    brew remove portaudio
    brew install portaudio
    pip3 install pyaudio
    

    So to clarify, Xcode is installed through the App Store. Xcode command line tools are required for some installations, for others they are not. I'm including it here just to be on the safe side. You also probably do not need to uninstall and reinstall the formula via Homebrew, I did that to ensure that there would be absolutely no problems.

    Edit: I have been told Homebrew requires Xcode. So just run the

    xcode-select --install
    

    command to be able to use Clang. Also what version of Mac are you on?

    0 讨论(0)
  • 2020-12-14 01:31

    Steps: I assume you are using a mac osx

    1. download homebrew by pasting this code at any terminal point /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

    2. After installing homebrew, install portaudio: brew install portaudio

    3. Finally install pyaudio using pip pip install pyaudio

    Note: Ensure you install homebrew if its not already installed

    0 讨论(0)
  • 2020-12-14 01:31

    For a mac, I think you have to type this into Terminal:

    sudo pip install pyaudio
    

    Also, you might have to install Xcode like said in one of the answers.

    0 讨论(0)
提交回复
热议问题