Problems while importing pyaudio

Tabish Imran picture Tabish Imran · Jun 15, 2015 · Viewed 8.6k times · Source

I recently bought a new laptop , and i moved my files from my old laptop. I was working on a project in pycharm which used the module pyaudio , i tried to run it and i got an error saying there is no module called pyaudio.

I ran "apt-get install python-pyaudio" , it was successful but the error persisted. Then i downloaded pyaudio from its website and installed the package.. the problem is still here , any ideas ?

Also , i changed the interpreter from 2.7 to 3 i , if thats any help.

Answer

x0x picture x0x · Jun 15, 2015

In PyCharm, go to file > settings > project > project interpreter

Select the python interpreter you want to use from the project interpreter dropdown. enter image description here Click on the green + button on the top left to add packages to the interpreter.

enter image description here
On the search box, type in PyAudio.

Select the package you want from the list,

Specify the version you want,

click install package

Note
Install virtualenv if you want to set a virtual env as the project interpreter. Else the changes will reset on PyCharm restart.