Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

Erro ao adicionar PyAudio no MacOS

Ao tentar adicionar o PyAudio, ele repassa a seguinte mensagem:

Collecting PyAudio
  Using cached https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz
Installing collected packages: PyAudio
  Running setup.py install for PyAudio: started
    Running setup.py install for PyAudio: finished with status 'error'
    Complete output from command /Users/alisonbabinski/PycharmProjects/rosie/venv/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/x5/4vw3p53s3nj3ks1558qftszh0000gn/T/pycharm-packaging/PyAudio/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/x5/4vw3p53s3nj3ks1558qftszh0000gn/T/pip-record-_6r5fqh2/install-record.txt --single-version-externally-managed --compile --install-headers /Users/alisonbabinski/PycharmProjects/rosie/venv/include/site/python3.7/PyAudio:
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-x86_64-3.7
    copying src/pyaudio.py -> build/lib.macosx-10.9-x86_64-3.7
    warning: build_py: byte-compiling is disabled, skipping.

    running build_ext
    building '_portaudio' extension
    creating build/temp.macosx-10.9-x86_64-3.7
    creating build/temp.macosx-10.9-x86_64-3.7/src
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DMACOSX=1 -I/Users/alisonbabinski/PycharmProjects/rosie/venv/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/_portaudiomodule.c -o build/temp.macosx-10.9-x86_64-3.7/src/_portaudiomodule.o
    src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found
    #include "portaudio.h"
             ^~~~~~~~~~~~~
    1 error generated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------

Command "/Users/alisonbabinski/PycharmProjects/rosie/venv/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/x5/4vw3p53s3nj3ks1558qftszh0000gn/T/pycharm-packaging/PyAudio/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/x5/4vw3p53s3nj3ks1558qftszh0000gn/T/pip-record-_6r5fqh2/install-record.txt --single-version-externally-managed --compile --install-headers /Users/alisonbabinski/PycharmProjects/rosie/venv/include/site/python3.7/PyAudio" failed with error code 1 in /private/var/folders/x5/4vw3p53s3nj3ks1558qftszh0000gn/T/pycharm-packaging/PyAudio/
You are using pip version 10.0.1, however version 20.3.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Alguma sugestão?

1 resposta
solução!

Dei uma procurada aqui e achei uma solução, e que pro meu caso funcionou. Segue a trilha pra caso aconteça o mesmo com alguém

O PyAudio é um dependência do Portaudio. Então é necessário instalar ele com esse comando no terminal:

brew install portaudio

Na minha instalação no primeiro momento apareceram alguns erros de permissões de diretórios, mas o próprio terminal ja informa quais comandos devem ser usados pra resolver tal empecilho.

Em seguida:

pip install pyAudio

Testado e funcionando :)