cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

Please let me know how i can install PyAudio using the Databricks notebook

ssm3819
New Contributor III

Hi,

i am trying to install the PyAudio package.

but i am getting the following error.

image.png 

Collecting pyaudio

 Using cached PyAudio-0.2.11.tar.gz (37 kB)

Building wheels for collected packages: pyaudio

 Building wheel for pyaudio (setup.py) ... error

 ERROR: Command errored out with exit status 1:

  command: /databricks/python3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-rvaxe7s2/pyaudio/setup.py'"'"'; __file__='"'"'/tmp/pip-install-rvaxe7s2/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/pip-wheel-bo6u1xp6

    cwd: /tmp/pip-install-rvaxe7s2/pyaudio/

 Complete output (16 lines):

 running bdist_wheel

 running build

 running build_py

 creating build

 creating build/lib.linux-x86_64-3.8

 copying src/pyaudio.py -> build/lib.linux-x86_64-3.8

 running build_ext

 building '_portaudio' extension

 creating build/temp.linux-x86_64-3.8

 creating build/temp.linux-x86_64-3.8/src

 x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/databricks/python3/include -I/usr/local/include/python3.8 -c src/_portaudiomodule.c -o build/temp.linux-x86_64-3.8/src/_portaudiomodule.o

 src/_portaudiomodule.c:29:10: fatal error: portaudio.h: No such file or directory

  #include "portaudio.h"

      ^~~~~~~~~~~~~

 compilation terminated.

 error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

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

 ERROR: 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

  ERROR: Command errored out with exit status 1:

   command: /databricks/python3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-rvaxe7s2/pyaudio/setup.py'"'"'; __file__='"'"'/tmp/pip-install-rvaxe7s2/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-record-nboxv47h/install-record.txt --single-version-externally-managed --compile --install-headers /databricks/python3/include/site/python3.8/pyaudio

     cwd: /tmp/pip-install-rvaxe7s2/pyaudio/

  Complete output (16 lines):

  running install

  running build

  running build_py

  creating build

  creating build/lib.linux-x86_64-3.8

  copying src/pyaudio.py -> build/lib.linux-x86_64-3.8

  running build_ext

  building '_portaudio' extension

  creating build/temp.linux-x86_64-3.8

  creating build/temp.linux-x86_64-3.8/src

  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/databricks/python3/include -I/usr/local/include/python3.8 -c src/_portaudiomodule.c -o build/temp.linux-x86_64-3.8/src/_portaudiomodule.o

  src/_portaudiomodule.c:29:10: fatal error: portaudio.h: No such file or directory

   #include "portaudio.h"

       ^~~~~~~~~~~~~

  compilation terminated.

  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

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

ERROR: Command errored out with exit status 1: /databricks/python3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-rvaxe7s2/pyaudio/setup.py'"'"'; __file__='"'"'/tmp/pip-install-rvaxe7s2/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-record-nboxv47h/install-record.txt --single-version-externally-managed --compile --install-headers /databricks/python3/include/site/python3.8/pyaudio Check the logs for full command output.

WARNING: You are using pip version 20.2.4; however, version 21.3.1 is available.

You should consider upgrading via the '/databricks/python3/bin/python -m pip install --upgrade pip' command.

3 REPLIES 3

Kaniz
Community Manager
Community Manager

Hi @ ssm3819 ! My name is Kaniz, and I'm the technical moderator here. Great to meet you, and thanks for your question! Let's see if your peers in the community have an answer to your question first. Or else I will get back to you soon. Thanks.

ssm3819
New Contributor III

thanks Kaniz

-werners-
Esteemed Contributor III

looks like missing dependencies on the server (linux): portaudio

This should be installed:

https://stackoverflow.com/questions/48690984/portaudio-h-no-such-file-or-directory

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.