JavaEar 专注于收集分享传播有价值的技术资料

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/';f=getattr(tokenize, 'open', open)(file);'\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


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


  1. 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