Problems while importing pyaudio

9.9k views Asked by At

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.

2

There are 2 answers

0
AudioBubble On BEST ANSWER

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.

0
Andersson On

Try to install PyAudio from here

If you installed package for certain Python version, after changing interpreter in PyCharm it will not be accessible. So install for other version also. This should work