Aryo
Aryo

Reputation: 43

PyAudio import error : ImportError: DLL load failed: The specified module could not be found

I encountered an import problem by PyAudio. I have a winodws 10, 64 bit, and use Anaconda and Spyder IDE with python 3.7. I installed PyAudio in Ananconda, ran as administrator, with these commands :

cd
conda install -c conda-forge PyAudio

The installation ran without any problems. I then restarted both Anaconda and SPYDER. PyAudio now shows up in Anaconda's list of installed packages.

When I try to import Pyaudio in Spyder (IPython console), I encounter this error message :

[1]: import pyaudio

Could not import the PyAudio C module '_portaudio'. Traceback (most recent call last):

File "", line 1, in import pyaudio

File "C:\ProgramData\Anaconda3\lib\site-packages\pyaudio.py", line 116, in import _portaudio as pa

ImportError: DLL load failed: The specified module could not be found.

I tried to fix it by answers to similar ImportError message issued, while other users tried to import other packages like SKlearn ... , but with no success.

Upvotes: 1

Views: 1472

Answers (2)

Thulfiqar
Thulfiqar

Reputation: 392

I tried to install portaudio using

conda install portaudio

but it seems like it didn't work as it should be. However,

conda install -c anaconda portaudio

solved the problem. see the official anaconda page

Upvotes: 0

swagless_monk
swagless_monk

Reputation: 471

Your problem (and mine) are the same. The issue is, unfortunately, the version of python you're running (in tandem with your OS).

Check out this link: https://people.csail.mit.edu/hubert/pyaudio/#:~:text=Note%3A%20As%20of%20this%20update,4.

Under the INSTALLATION section in the link for WINDOWS, PyAudio's latest version (0.2.11) is compatible with Python versions: 2.7, 3.4, 3.5, 3.6.

My current python is 3.8.5, so you (and I) could never use PyAudio unless they added compatibilities or we revert to an above python version.

Upvotes: 1

Related Questions