Skip to content
Advertisement

Getting error with PyAudio even though I have the latest PyAudio

I am trying to run the following python program but i am getting some errors. The program is intended to convert livespeech to text and it is using an acoustic model which I have trained using CMUSphinx.

The code:

JavaScript

The Traceback:

JavaScript

But I have already installed PyAudio 0.2.11. When I do pip install pyaudio, I get the following:

Requirement already satisfied: pyaudio in /usr/local/lib/python3.5/dist-packages (0.2.11)

Advertisement

Answer

Your error message indicates that it is using a pyaudio installed in python2.7, but your error message at the bottom is referencing a pyaudio in python3. Try using python3 explicitly to call the program. You can ensure that by doing the following:

  1. Change the shebang line at the top of the file to tell the shell what to use to execute the script:
JavaScript
  1. invoke it directly on the command line when calling the script:
JavaScript

These will fix your issue and use the correct version of python to run the program.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement