Search code examples
pythonpython-3.xpyaudio

ModuleNotFoundError: No module named 'pyaudio'


I ran pip install pyaudio in my terminal and got this error:

Command "/home/oliver/anaconda3/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-ub9alt7s/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-e9_md34a-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ub9alt7s/pyaudio/

So I ran sudo apt-install python-pyaudio python3-pyaudio

which seemed to work.

Then in jupyter: import pyaudio

error:

ModuleNotFoundError: No module named 'pyaudio'

Can anyone help me work out this problem? I am not familiar with Ubuntu and it's commands paths etc as I've only been using it a few months.

If you need more information, let me know what, and how. Thanks


Solution

  • Check in the documentation of pyaudio if it is compatible with your python version
    Some modules which are not compatible may be installed without issues,
    yet still won't work when trying to access them