Pyaudio installed with Conda but not found on Import

18 Views Asked by At

I have installed pyaudio with conda, but my jupyter notebook can't find the module pyaudio on import. I have trying uninstalling and reinstalling with no success. Here is a few relevant information:

On my second attempt, I first ran conda config --add channels conda-forge and then conda install pyaudio. Packages installed this way were:

Package Build
alsa-lib-1.2.11 hd590300_1 542 KB conda-forge
jack-1.9.22 h7c63dc7_2 453 KB conda-forge
libdb-6.2.32 h9c3ff4c_0 23.3 MB conda-forge
libopus-1.3.1 h7f98852_1 255 KB conda-forge
openssl-3.2.1 hd590300_1 2.7 MB conda-forge
portaudio-19.6.0 h7c63dc7_9 113 KB conda-forge
pyaudio-0.2.14 py311h459d7ec_0 37 KB conda-forge

This was better than the first time (without conda-forge), where I just got the last two packages.

Other relevant information:

  • My version of python is 3.11.8

  • conda list | grep pyaudio yields pyaudio 0.2.14 py311h459d7ec_0 conda-forge

  • Conda and python (3) seems to be in the same path, that is running which on them gives: /home/andrea/anaconda3/bin/conda /home/andrea/anaconda3/bin/python /home/andrea/anaconda3/bin/python3

  • pip show pyaudio gives

    Name: PyAudio
    Version: 0.2.14
    Summary: Cross-platform audio I/O with PortAudio
    Home-page: https://people.csail.mit.edu/hubert/pyaudio/
    Author: Hubert Pham
    Author-email:
    License: MIT
    Location: /home/andrea/anaconda3/lib/python3.11/site-packages
    Requires:
    Required-by:
  • Running the code on a script audio-attempt.py instead of jupyter does not change the error
  • echo $PYTHONPATH yields an empty string. However, I guess there is a default value if the latter is empty, since other modules are normally loaded.

If you need anything else, I will be happy to share. Thanks for the help.

0

There are 0 best solutions below