Pip 在Windows 10上使用Python 3.7.7(x64)导入Sounddevice时失败
当我尝试运行以下脚本或顶部带有Pip 在Windows 10上使用Python 3.7.7(x64)导入Sounddevice时失败,pip,python-sounddevice,Pip,Python Sounddevice,当我尝试运行以下脚本或顶部带有import sounddevice的任何脚本时,会收到此错误消息。我用pip install sounddevice在cmd上安装了声音设备,并用pip list Assertion failed! Program: C:\Program Files\Python37\python.exe File: src/hostapi/wdmks/pa_win_wdmks.c, Line 1061 Expression: FALSE 示例程序: import soun
import sounddevice
的任何脚本时,会收到此错误消息。我用pip install sounddevice
在cmd上安装了声音设备,并用pip list
Assertion failed!
Program: C:\Program Files\Python37\python.exe
File: src/hostapi/wdmks/pa_win_wdmks.c, Line 1061
Expression: FALSE
示例程序:
import sounddevice
sounddevice.get_portaudio_version()
input('enter to exit')
另一个示例程序(来自):
更新/进一步澄清:
我尝试重新安装sounddevice和python,并改用sounddevice 0.3.12或python 3.8.3。我一次只安装了1个版本的python。我有胆量已经很长时间了,这很有效
从https://www.lfd.uci.edu/~gohlke/pythonlibs/#sounddevice
和ranpip-install-sounddevice-0.3.15-cp37-cp37m-win_amd64.whl
已安装但产生相同的“断言失败”错误。我不认为这是相关的,但是我不能做<代码> PIP安装PyoDodie<代码> BC,它说<代码>微软Visual C++ 14是必需的< /C> >,尽管我安装了VisualStudio构建工具2019,所以我下载了PyoDoE的GoHLKEWHL,突然声音设备工作了…所以这有点解决了,但我不明白。也许portaudio并不像sounddevice文档所说的那样“自动”包含在sounddevice for Windows中
更新2:我卸载了sounddevice whl,并使用pypl版本重新安装,使用的是
pip安装sounddevice
,现在它也可以工作了 看,我在那个线程中尝试了一些方法,但这些方法本身似乎还没有解决,而且对我也不起作用。我编辑了我的原始帖子,以包含我在该线程中尝试过的内容,只是为了确保,pip install sounddevice-0.3.15-cp37-cp37m-win_amd64。除非先用pip uninstall sounddevice卸载sounddevice
卸载sounddevice,否则whl将不会安装控制盘。顺便说一句,谢谢你的知识库和你所有的工作;对我来说至关重要!看,我在那个线程中尝试了一些方法,但这些方法本身似乎还没有解决,而且对我也不起作用。我编辑了我的原始帖子,以包含我在该线程中尝试过的内容,只是为了确保,pip install sounddevice-0.3.15-cp37-cp37m-win_amd64。除非先用pip uninstall sounddevice卸载sounddevice
卸载sounddevice,否则whl将不会安装控制盘。顺便说一句,谢谢你的知识库和你所有的工作;对我来说至关重要!
import sounddevice as sd
import soundfile as sf
data, fs = sf.read('ImperialMarch60.wav')
sd.play(data, fs)
status = sd.wait()