简体   繁体   English

PyAudio(PortAudio问题)Python

[英]PyAudio (PortAudio issue) Python

I installed pyaudio with anaconda python. 我用anaconda python安装了pyaudio。 Using conda install pyaudio on windows. 使用conda install pyaudio在Windows上conda install pyaudio It said it installed and it also installed PortAudio with it. 它表示已安装,并且还安装了PortAudio

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.

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. 我能够解决此问题的唯一方法是卸载anaconda,安装最新版本的python,然后重新安装最新版本的conda。

I then downloaded the latest .whl file for pyaudio which can be found here: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio 然后我下载了用于pyaudio的最新.whl文件,该文件可以在以下位置找到: 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 我将此文件从下载的文件移到anaconda3的site-packages文件夹中: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 在anaconda提示符下运行命令“ pip install pyaudio”或“ python -m pip install pyaudio”后,我很好

I hope this helps! 我希望这有帮助!

I ran into this error with win32 py3 using Anaconda3. 我使用Anaconda3在win32 py3中遇到了此错误。 Re-installing portaudio fixed this: 重新安装portaudio可以解决此问题:

conda install portaudio

It just updated the package for me, and pyaudio was able to find the DLL then. 它只是为我更新了软件包,然后pyaudio能够找到DLL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM