Reputation: 21
how to install pyaudio on heroku through heroku cli if i give "pip install pyaudio" command on heroku cli the below error occurring
Error: Collecting pyaudio Downloading https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz Building wheels for collected packages: pyaudio Running setup.py bdist_wheel for pyaudio ... - \ error Complete output from command /app/.heroku/python/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-vz9795ay/pyaudio/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /tmp/tmpmq8ff3y9pip-wheel- --python-tag cp36: running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.6 copying src/pyaudio.py -> build/lib.linux-x86_64-3.6 running build_ext building '_portaudio' extension creating build/temp.linux-x86_64-3.6 creating build/temp.linux-x86_64-3.6/src gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/app/.heroku/python/include/python3.6m -c src/_portaudiomodule.c -o build/temp.linux-x86_64-3.6/src/_portaudiomodule.o src/_portaudiomodule.c:27:10: fatal error: stdio.h: No such file or directory #include ^~~~~~~~~ compilation terminated. error: command 'gcc' failed with exit status 1
Failed building wheel for pyaudio Running setup.py clean for pyaudio Failed to build pyaudio Installing collected packages: pyaudio Running setup.py install for pyaudio ... - error Complete output from command /app/.heroku/python/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-vz9795ay/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 /tmp/pip-gdj2okkn-record/install-record.txt --single-version-externally-managed --compile: running install running build running build_py creating build creating build/lib.linux-x86_64-3.6 copying src/pyaudio.py -> build/lib.linux-x86_64-3.6 running build_ext building '_portaudio' extension creating build/temp.linux-x86_64-3.6 creating build/temp.linux-x86_64-3.6/src gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/app/.heroku/python/include/python3.6m -c src/_portaudiomodule.c -o build/temp.linux-x86_64-3.6/src/_portaudiomodule.o src/_portaudiomodule.c:27:10: fatal error: stdio.h: No such file or directory #include ^~~~~~~~~ compilation terminated. error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/app/.heroku/python/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-vz9795ay/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 /tmp/pip-gdj2okkn-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-vz9795ay/pyaudio/ You are using pip version 9.0.2, however version 19.3.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command.
Upvotes: 1
Views: 1147
Reputation: 147
you need to install heroku buildpacks:add --index 1 heroku-community/apt
from your console, then include a file named Aptfile
in your project root, after that include portaudio19-dev
python-all-dev
inside the Aptfile
file, finally, you need to make a commit and run the command git push heroku master
You can see some more info here: https://github.com/heroku/heroku-buildpack-apt
Upvotes: 2