cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
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.

2 REPLIES 2

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

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group