PortAudio library not found by sounddevice

I have been working with a python program which uses sounddevice module to play audio. The program works fine in my office pc (running Ubuntu 17.10), but not in my home pc (running Linux Mint 18.3). It generates the following error:

I have been working with a python program which uses sounddevice module to play audio. The program works fine in my office pc (running Ubuntu 17.10), but not in my home pc (running Linux Mint 18.3). It generates the following error:

Traceback (most recent call last): File "...path/to/my/code.py", line 11, in <module> import sounddevice as sd File "/home/arif/anaconda3/lib/python3.6/site-packages/sounddevice.py", line 64, in <module> raise OSError('PortAudio library not found') OSError: PortAudio library not found 

How can I fix this problem?

5

2 Answers

I could fix this by installing the portaudio library.

sudo apt-get install libportaudio2 

You may also try following if this doesn't help.

sudo apt-get install libasound-dev 
4

I have Rocky Linux 9, which is based on RHEL. I also fixed that by installing the portaudio package via this command:

dnf install portaudio portaudio-devel 

It might be useful for Rocky Linux users.

ncG1vNJzZmirpJawrLvVnqmfpJ%2Bse6S7zGiorp2jqbawutJoa3JrY2iCeX6OqaarrJGqsaq7jKWgm6qRp8Zuus6tZJ%2BnpaOxbq7YZqqorZ6ZsabCyJyc

 Share!