PyAudio (PortAudio issue) Python

試著忘記壹切 提交于 2019-12-11 06:55:20

问题


I installed pyaudio with anaconda python. Using conda install pyaudio on windows. It said it installed and it also installed PortAudio with it.

However, when I create my file and run it now I get the following issue.

I have no idea what is going on.

Could not import the PyAudio C module '_portaudio'.
Traceback (most recent call last):
  File "C:\Users\This PC\Desktop\Py\demo.py", line 2, in <module>
    import pyaudio
  File "C:\Users\This PC\Anaconda3\lib\site-packages\pyaudio.py", line 116, in <module>
    import _portaudio as pa
ImportError: DLL load failed: The specified module could not be found.

回答1:


I faced a similar issue.

The only way I was able to resolve this was by uninstalling anaconda, installing the latest version of python, and reinstalling the latest version of conda.

I then downloaded the latest .whl file for pyaudio which can be found here: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio

I moved this file from my downloads and into the site-packages folder of anaconda3: C:\Users\Projects\Anaconda3\Lib\site-packages

Upon running the command 'pip install pyaudio' OR 'python -m pip install pyaudio' in the anaconda prompt I was good to go

I hope this helps!




回答2:


I ran into this error with win32 py3 using Anaconda3. Re-installing portaudio fixed this:

conda install portaudio

It just updated the package for me, and pyaudio was able to find the DLL then.



来源:https://stackoverflow.com/questions/51998310/pyaudio-portaudio-issue-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!